Skip to content

Commit

Permalink
Merge branch 'master' into crazymanish-xcodebuild-destination-param-fix
Browse files Browse the repository at this point in the history
* master:
  [pilot] added the Pilot::TesterExporter class unit tests (#20394)
  Add device Google Pixel 5 (#20389)
  [action][update_info_plist] improve the plist file-path option validation check (#20356)
  Specify s3 object prefix (#20344)
  [snapshot] Add missing iPod touch to Generated Snapshot Reports (#20337)
  [Ruby] Ruby 2.6 is now the minimum (dropping Ruby 2.5) (#20413)
  • Loading branch information
crazymanish committed Jun 26, 2022
2 parents e7b2150 + 9459056 commit 6ca9e1b
Show file tree
Hide file tree
Showing 10 changed files with 158 additions and 11 deletions.
10 changes: 3 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ workflows:
version: 2
build:
jobs:
- tests_macos:
name: 'Execute tests on macOS (Xcode 11.7.0, Ruby 2.5)'
xcode_version: '11.7.0'
ruby_version: '2.5'
- tests_macos:
name: 'Execute tests on macOS (Xcode 11.7.0, Ruby 2.6)'
xcode_version: '11.7.0'
Expand Down Expand Up @@ -286,10 +282,10 @@ workflows:
ruby_version: '2.7'
- validate_documentation:
name: 'Validate Documentation'
ruby_version: 'circleci/ruby:2.5'
ruby_version: 'fastlanetools/ci:0.3.0'
- lint_source_code:
name: 'Lint source code'
ruby_version: 'circleci/ruby:2.5'
ruby_version: 'circleci/ruby:2.6'
- modules_load_up_tests:
name: 'Modules load up tests'
ruby_version: 'circleci/ruby:2.5'
ruby_version: 'circleci/ruby:2.6'
8 changes: 7 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require:
- ./rubocop/is_string_usage.rb

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.6
NewCops: enable
Include:
- '**/*.rb'
Expand All @@ -24,6 +24,12 @@ AllCops:
- '**/spec/fixtures/broken_files/broken_file.rb'
- '**/*.provisionprofile'

Lint/ErbNewArguments:
Enabled: false

Style/SlicingWithRange:
Enabled: false

Style/MultipleComparison:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion fastlane.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Gem::Specification.new do |spec|
"source_code_uri" => "https://github.com/fastlane/fastlane"
}

spec.required_ruby_version = '>= 2.5'
spec.required_ruby_version = '>= 2.6'

spec.files = Dir.glob("*/lib/**/*", File::FNM_DOTMATCH) + Dir["fastlane/swift/**/*"] + Dir["bin/*"] + Dir["*/README.md"] + %w(README.md LICENSE .yardopts) - Dir["fastlane/lib/fastlane/actions/device_grid/assets/*"] - Dir["fastlane/lib/fastlane/actions/docs/assets/*"]
spec.bindir = "bin"
Expand Down
2 changes: 1 addition & 1 deletion fastlane/lib/fastlane/actions/update_info_plist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def self.available_options
description: "Path to info plist",
optional: true,
verify_block: proc do |value|
UI.user_error!("Invalid plist file") unless value[-6..-1].casecmp(".plist").zero?
UI.user_error!("Invalid plist file") unless value.downcase.end_with?(".plist")
end),
FastlaneCore::ConfigItem.new(key: :scheme,
env_name: "FL_UPDATE_PLIST_APP_SCHEME",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.5'
spec.required_ruby_version = '>= 2.6'

# Don't add a dependency to fastlane or fastlane_re
# since this would cause a circular dependency
Expand Down
2 changes: 2 additions & 0 deletions frameit/lib/frameit/device_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module Color
MIDNIGHT ||= "Midnight"
STARLIGHT ||= "Starlight"
SIERRA ||= "Sierra"
SORTA_SAGE ||= "Sorta Sage"

def self.all_colors
Color.constants.map { |c| Color.const_get(c).upcase.gsub(' ', '_') }
Expand Down Expand Up @@ -85,6 +86,7 @@ module Devices
# Google Pixel 4's priority should be higher than Samsung Galaxy S10+ (priority 8):
GOOGLE_PIXEL_4 ||= Frameit::Device.new("google-pixel-4", "Google Pixel 4", 9, [[1080, 2280], [2280, 1080]], 444, Color::JUST_BLACK, Platform::ANDROID)
GOOGLE_PIXEL_4_XL ||= Frameit::Device.new("google-pixel-4-xl", "Google Pixel 4 XL", 9, [[1440, 3040], [3040, 1440]], 537, Color::JUST_BLACK, Platform::ANDROID)
GOOGLE_PIXEL_5 ||= Frameit::Device.new("google-pixel-5", "Google Pixel 5", 10, [[1080, 2340], [2340, 1080]], 432, Color::JUST_BLACK, Platform::ANDROID)
HTC_ONE_A9 ||= Frameit::Device.new("htc-one-a9", "HTC One A9", 6, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
HTC_ONE_M8 ||= Frameit::Device.new("htc-one-m8", "HTC One M8", 3, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
HUAWEI_P8 ||= Frameit::Device.new("huawei-p8", "Huawei P8", 5, [[1080, 1920], [1920, 1080]], 424, Color::BLACK, Platform::ANDROID)
Expand Down
6 changes: 6 additions & 0 deletions frameit/spec/device_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def expect_forced_screen_size(value)
end

describe "valid Android screen sizes" do

it "should detect Google Pixel 5 in portrait and landscape based on priority" do
expect_screen_size_from_file("pixel-portrait{1080x2340}.png", Platform::ANDROID).to eq(Devices::GOOGLE_PIXEL_5)
expect_screen_size_from_file("pixel-landscape{2340x1080}.png", Platform::ANDROID).to eq(Devices::GOOGLE_PIXEL_5)
end

it "should detect Google Pixel 3 XL in portrait and landscape based on priority" do
expect_screen_size_from_file("pixel-portrait{1440x2960}.png", Platform::ANDROID).to eq(Devices::GOOGLE_PIXEL_3_XL)
expect_screen_size_from_file("pixel-landscape{2960x1440}.png", Platform::ANDROID).to eq(Devices::GOOGLE_PIXEL_3_XL)
Expand Down
1 change: 1 addition & 0 deletions match/lib/match/nuke.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def run(params, type: nil)
s3_access_key: params[:s3_access_key].to_s,
s3_secret_access_key: params[:s3_secret_access_key].to_s,
s3_bucket: params[:s3_bucket].to_s,
s3_object_prefix: params[:s3_object_prefix].to_s,
team_id: params[:team_id] || Spaceship::ConnectAPI.client.portal_team_id
})
self.storage.download
Expand Down
135 changes: 135 additions & 0 deletions pilot/spec/test_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
require 'csv'

describe Pilot::TesterExporter do
describe ".export_testers" do
let(:fake_tester_exporter) { Pilot::TesterExporter.new }
let(:fake_tester_manager) { double("tester manager") }
let(:fake_testers_file_path) { "fake testers_file_path" }
let(:fake_apple_id) { "fake apple_id" }
let(:fake_app_identifier) { "fake app_identifier" }
let(:fake_input_options) do
{
testers_file_path: fake_testers_file_path,
apple_id: fake_apple_id,
app_identifier: fake_app_identifier
}
end

before(:each) do
fake_tester_exporter.instance_variable_set(:@config, fake_input_options)
allow(Pilot::TesterManager).to receive(:new).and_return(fake_tester_manager)
allow(fake_tester_exporter).to receive(:start).with(fake_input_options)
end

context "when able to find app using apple_id and app_identifier" do
let(:fake_app) { "fake app" }

before(:each) do
allow(fake_app).to receive(:get_beta_testers).with(includes: "apps,betaTesterMetrics,betaGroups").and_return([])
allow(fake_tester_exporter).to receive(:find_app).with(apple_id: fake_apple_id, app_identifier: fake_app_identifier).and_return(fake_app)
end

it "exports beta testers inside the correct file path" do
expect(CSV).to receive(:open).with(fake_testers_file_path, "w")

fake_tester_exporter.export_testers(fake_input_options)
end

it "shows a success message after export" do
expect(UI).to receive(:success).with("Successfully exported CSV to #{fake_testers_file_path}")

fake_tester_exporter.export_testers(fake_input_options)
end
end

context "when failed to find app using apple_id and app_identifier" do
let(:fake_app) { "fake app" }

before(:each) do
allow(fake_tester_exporter).to receive(:find_app).with(apple_id: fake_apple_id, app_identifier: fake_app_identifier).and_return(nil)
allow(Spaceship::ConnectAPI::BetaTester).to receive(:all).with(includes: "apps,betaTesterMetrics,betaGroups").and_return([])
end

it "exports beta testers inside the correct file path" do
expect(CSV).to receive(:open).with(fake_testers_file_path, "w")

fake_tester_exporter.export_testers(fake_input_options)
end

it "shows a success message after export" do
expect(UI).to receive(:success).with("Successfully exported CSV to #{fake_testers_file_path}")

fake_tester_exporter.export_testers(fake_input_options)
end
end
end

describe ".find_app" do
let(:fake_tester_exporter) { Pilot::TesterExporter.new }
let(:fake_app) { "fake app" }

context "when app_identifier is given" do
let(:fake_app_identifier) { "fake app_identifier" }

context "when able to find app using app_identifier" do
before(:each) do
allow(Spaceship::ConnectAPI::App).to receive(:find).with(fake_app_identifier).and_return(fake_app)
end

it "returns the app correctly" do
received_app = fake_tester_exporter.find_app(app_identifier: fake_app_identifier)

expect(received_app).to eq(fake_app)
end
end

context "when failed to find app using app_identifier" do
before(:each) do
allow(Spaceship::ConnectAPI::App).to receive(:find).with(fake_app_identifier).and_return(nil)
end

it "raises an fatal exception with message" do
expect(UI).to receive(:user_error!).with("Could not find an app by #{fake_app_identifier}")

fake_tester_exporter.find_app(app_identifier: fake_app_identifier)
end
end
end

context "when app_identifier is not given but apple_id is given" do
let(:fake_apple_id) { "fake apple_id" }

context "when able to find app using apple_id" do
before(:each) do
allow(Spaceship::ConnectAPI::App).to receive(:get).with(app_id: fake_apple_id).and_return(fake_app)
end

it "returns the app correctly" do
received_app = fake_tester_exporter.find_app(apple_id: fake_apple_id)

expect(received_app).to eq(fake_app)
end
end

context "when failed to find app using apple_id" do
before(:each) do
allow(Spaceship::ConnectAPI::App).to receive(:get).with(app_id: fake_apple_id).and_return(nil)
end

it "raises an fatal exception with message" do
expect(UI).to receive(:user_error!).with("Could not find an app by #{fake_apple_id}")

fake_tester_exporter.find_app(apple_id: fake_apple_id)
end
end
end

context "when app_identifier and apple_id both are not given" do
it "raises an fatal exception with message" do
expect(UI).to receive(:user_error!).with("You must include an `app_identifier` to `list_testers`")

fake_tester_exporter.find_app
end
end
end
end
1 change: 1 addition & 0 deletions snapshot/lib/snapshot/reports_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def xcode_9_and_above_device_name_mappings
'iPad Pro (12.9-inch)' => 'iPad Pro (12.9-inch)',
'iPad Pro (12.9 inch)' => 'iPad Pro (12.9-inch)', # iOS 10.3.1 simulator
'iPad Pro' => 'iPad Pro (12.9-inch)', # iOS 9.3 simulator
'iPod touch (7th generation)' => 'iPod touch (7th generation)',
'Apple TV 1080p' => 'Apple TV',
'Apple TV 4K (at 1080p)' => 'Apple TV 4K (at 1080p)',
'Apple TV 4K' => 'Apple TV 4K',
Expand Down

0 comments on commit 6ca9e1b

Please sign in to comment.