Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[match][sigh] add support for Apple Silicon Macs in iOS/iPadOS provisioning profiles #20676

Merged
merged 7 commits into from Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions match/spec/runner_spec.rb
Expand Up @@ -386,6 +386,19 @@
runner = Match::Runner.new
expect(runner.device_count_different?(profile: profile_file, platform: :ios)).to be(true)
end

it "device is apple silicon mac" do
expect(FastlaneCore::ProvisioningProfile).to receive(:parse).twice.and_return(parsed_profile)
expect(Spaceship::ConnectAPI::Profile).to receive(:all).twice.and_return([profile])
expect(Spaceship::ConnectAPI::Device).to receive(:all).twice.and_return([profile_device])

expect(profile_device).to receive(:device_class).twice.and_return(Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC)
expect(profile_device).to receive(:enabled?).and_return(true)

runner = Match::Runner.new
expect(runner.device_count_different?(profile: profile_file, platform: :ios, include_mac_in_profiles: false)).to be(true)
expect(runner.device_count_different?(profile: profile_file, platform: :ios, include_mac_in_profiles: true)).to be(false)
end
end
end
end
17 changes: 17 additions & 0 deletions sigh/spec/runner_spec.rb
Expand Up @@ -151,6 +151,23 @@
expect(devices.size).to eq(1)
end

it "devices for development with apple silicon" do
options = { development: true, include_mac_in_profiles: true }
Sigh.config = FastlaneCore::Configuration.create(Sigh::Options.available_options, options)

ios_device = "ios_device"
allow(ios_device).to receive(:id).and_return(1)
allow(ios_device).to receive(:device_class).and_return(Spaceship::ConnectAPI::Device::DeviceClass::IPHONE)
as_device = "as_device"
allow(as_device).to receive(:id).and_return(2)
allow(as_device).to receive(:device_class).and_return(Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC)

expect(Spaceship::ConnectAPI::Device).to receive(:all).and_return([ios_device, as_device])

devices = fake_runner.devices_to_use
expect(devices.size).to eq(2)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but I kinda have the feeling you're allowing too many statements here 😬 not sure if this really attests the functionality you implemented, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @PinkidG , WDYT? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rogerluan Thanks for the feedback, I'm sorry I didn't get back to it. I'm not really a ruby expert tbh. 😅

I'll try to improve it 🙂


it "devices for adhoc" do
options = { adhoc: true }
Sigh.config = FastlaneCore::Configuration.create(Sigh::Options.available_options, options)
Expand Down