From b765cb4fdc9f35643bae857f6389f3c0479327cb Mon Sep 17 00:00:00 2001 From: Naveen Nazimudeen Date: Thu, 26 Dec 2024 16:26:46 -0500 Subject: [PATCH 1/6] added testFlightInternalTestingOnly appStore option --- exportoptions/appstore_options.go | 5 +++++ exportoptions/properties.go | 2 ++ 2 files changed, 7 insertions(+) diff --git a/exportoptions/appstore_options.go b/exportoptions/appstore_options.go index 187dbbf7..c93f4a4b 100644 --- a/exportoptions/appstore_options.go +++ b/exportoptions/appstore_options.go @@ -22,6 +22,8 @@ type AppStoreOptionsModel struct { UploadSymbols bool // Should Xcode manage the app's build number when uploading to App Store Connect? Defaults to YES. ManageAppVersion bool + // TestFlightInternalTestingOnly + TestFlightInternalTestingOnly bool } // NewAppStoreOptions ... @@ -73,6 +75,9 @@ func (options AppStoreOptionsModel) Hash() map[string]interface{} { if options.Destination != "" { hash[DestinationKey] = options.Destination } + if options.TestFlightInternalTestingOnly { + hash[TestFlightInternalTestingOnlyKey] = options.TestFlightInternalTestingOnly + } return hash } diff --git a/exportoptions/properties.go b/exportoptions/properties.go index 66069d7f..369509dc 100644 --- a/exportoptions/properties.go +++ b/exportoptions/properties.go @@ -177,6 +177,8 @@ const ( const DestinationKey = "destination" +const TestFlightInternalTestingOnlyKey = "testFlightInternalTestingOnly" + type Destination string // Destination ... From 76c1056b5775624c616221b5926673e53fc4778e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krisztia=CC=81n=20Go=CC=88drei?= Date: Tue, 7 Jan 2025 09:26:24 +0100 Subject: [PATCH 2/6] Update bitrise.yml --- bitrise.yml | 105 +++++----------------------------------------------- 1 file changed, 10 insertions(+), 95 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index 5346a200..491f081d 100755 --- a/bitrise.yml +++ b/bitrise.yml @@ -1,19 +1,13 @@ -format_version: 1.0.0 +format_version: "11" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git -app: - envs: - - ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR - workflows: - ci: + check: before_run: - test - - swiftpm_cache + - integration_test test: - after_run: - - integration-test steps: - git::https://github.com/bitrise-steplib/steps-check.git: title: Lint @@ -25,92 +19,13 @@ workflows: - exclude: "*/mocks" - go-test: { } - integration-test: - steps: - - script: - title: Run integration tests - inputs: - - content: |- - #!/bin/bash - echo "Running integration tests ..." - set -ex - - go test -v ./_tests/integration/... - - _swiftpm_step: - envs: - - CURRENT_PROJECT_PATH: $CURRENT_PROJECT_PATH - - BITRISE_ACCESS_TOKEN: $BITRISE_ACCESS_TOKEN + integration_test: steps: - - build-router-start: - inputs: - - workflows: swiftpm_run_xcodebuild - - wait_for_builds: "true" - - access_token: $BITRISE_ACCESS_TOKEN - - environment_key_list: CURRENT_PROJECT_PATH - - verbose: "yes" - - swiftpm_run_xcodebuild: - envs: - - CURRENT_PROJECT_PATH: $CURRENT_PROJECT_PATH - - SAMPLES_DIR: $ORIG_BITRISE_SOURCE_DIR/_checkout - steps: - - script: - title: Cleanup $TMP_DIR - inputs: - - content: | - #!/bin/bash - set -ex - - rm -rf $SAMPLES_DIR - mkdir $SAMPLES_DIR - git clone https://github.com/bitrise-io/sample-apps-ios-swiftpm.git -b master $SAMPLES_DIR - - rm -rf /Users/lpusok/Library/Developer/Xcode/DerivedData/* - - cache-pull: - run_if: true - inputs: - - is_debug_mode: true - - xcode-test: - title: Run xcodebuild + - change-workdir: inputs: - - project_path: $SAMPLES_DIR/$CURRENT_PROJECT_PATH/sample-swiftpm2.xcodeproj - - scheme: sample-swiftpm2 - - cache_level: swift_packages - - cache-push: - title: Push cache - run_if: true - is_skippable: false + - path: ./_integration_tests + - go-list: { } + - go-test: { } + - change-workdir: inputs: - - is_debug_mode: true - - _swiftpm_step2: - envs: - - CURRENT_PROJECT_PATH: sample-swiftpm2 - after_run: - - _swiftpm_step - - _swiftpm_step3: - envs: - - CURRENT_PROJECT_PATH: sample-swiftpm3 - after_run: - - _swiftpm_step - - _swiftpm_step5: - envs: - - CURRENT_PROJECT_PATH: sample-swiftpm5 - after_run: - - _swiftpm_step - - _swiftpm_step7: - envs: - - CURRENT_PROJECT_PATH: sample-swiftpm7 - after_run: - - _swiftpm_step - - swiftpm_cache: - after_run: - - _swiftpm_step2 - - _swiftpm_step3 - - _swiftpm_step5 - - _swiftpm_step7 + - path: .. From f1eda809e15977bcec37db0a4eb0e581a41666b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krisztia=CC=81n=20Go=CC=88drei?= Date: Tue, 7 Jan 2025 09:31:18 +0100 Subject: [PATCH 3/6] Remove integration tests workflow --- bitrise.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index 491f081d..e3be1e34 100755 --- a/bitrise.yml +++ b/bitrise.yml @@ -5,7 +5,6 @@ workflows: check: before_run: - test - - integration_test test: steps: @@ -18,14 +17,3 @@ workflows: inputs: - exclude: "*/mocks" - go-test: { } - - integration_test: - steps: - - change-workdir: - inputs: - - path: ./_integration_tests - - go-list: { } - - go-test: { } - - change-workdir: - inputs: - - path: .. From 0bf72cb991cb36f30dfe6a46ed6a8326b3be6549 Mon Sep 17 00:00:00 2001 From: Naveen Nazimudeen Date: Tue, 7 Jan 2025 18:54:48 -0500 Subject: [PATCH 4/6] 1. Added TestFlightInternalTestingOnlyDefault 2. Added tests to check for TestFlightInternalTestingOnly in TestAppStoreOptionsToHash --- exportoptions/appstore_options.go | 11 ++++++----- exportoptions/exportoptions_test.go | 9 ++++++++- exportoptions/properties.go | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/exportoptions/appstore_options.go b/exportoptions/appstore_options.go index c93f4a4b..f118c70c 100644 --- a/exportoptions/appstore_options.go +++ b/exportoptions/appstore_options.go @@ -22,16 +22,17 @@ type AppStoreOptionsModel struct { UploadSymbols bool // Should Xcode manage the app's build number when uploading to App Store Connect? Defaults to YES. ManageAppVersion bool - // TestFlightInternalTestingOnly + TestFlightInternalTestingOnly bool } // NewAppStoreOptions ... func NewAppStoreOptions() AppStoreOptionsModel { return AppStoreOptionsModel{ - UploadBitcode: UploadBitcodeDefault, - UploadSymbols: UploadSymbolsDefault, - ManageAppVersion: manageAppVersionDefault, + UploadBitcode: UploadBitcodeDefault, + UploadSymbols: UploadSymbolsDefault, + ManageAppVersion: manageAppVersionDefault, + TestFlightInternalTestingOnly: TestFlightInternalTestingOnlyDefault, } } @@ -75,7 +76,7 @@ func (options AppStoreOptionsModel) Hash() map[string]interface{} { if options.Destination != "" { hash[DestinationKey] = options.Destination } - if options.TestFlightInternalTestingOnly { + if options.TestFlightInternalTestingOnly != TestFlightInternalTestingOnlyDefault { hash[TestFlightInternalTestingOnlyKey] = options.TestFlightInternalTestingOnly } return hash diff --git a/exportoptions/exportoptions_test.go b/exportoptions/exportoptions_test.go index 6c62026a..468e910e 100644 --- a/exportoptions/exportoptions_test.go +++ b/exportoptions/exportoptions_test.go @@ -111,6 +111,7 @@ func TestNewAppStoreOptions(t *testing.T) { options := NewAppStoreOptions() require.Equal(t, UploadBitcodeDefault, options.UploadBitcode) require.Equal(t, UploadSymbolsDefault, options.UploadSymbols) + require.Equal(t, TestFlightInternalTestingOnlyDefault, options.TestFlightInternalTestingOnly) } } @@ -136,9 +137,10 @@ func TestAppStoreOptionsToHash(t *testing.T) { options.UploadBitcode = false options.UploadSymbols = false options.ManageAppVersion = false + options.TestFlightInternalTestingOnly = true hash := options.Hash() - require.Equal(t, 5, len(hash)) + require.Equal(t, 6, len(hash)) { value, ok := hash[MethodKey] @@ -165,6 +167,11 @@ func TestAppStoreOptionsToHash(t *testing.T) { require.True(t, ok) require.Equal(t, false, value) } + { + value, ok := hash[TestFlightInternalTestingOnlyKey] + require.True(t, ok) + require.Equal(t, true, value) + } } } diff --git a/exportoptions/properties.go b/exportoptions/properties.go index 369509dc..84f8d194 100644 --- a/exportoptions/properties.go +++ b/exportoptions/properties.go @@ -177,6 +177,7 @@ const ( const DestinationKey = "destination" +const TestFlightInternalTestingOnlyDefault = false const TestFlightInternalTestingOnlyKey = "testFlightInternalTestingOnly" type Destination string From 4721e72110e238bf2f4b633261c455d4661c4195 Mon Sep 17 00:00:00 2001 From: Naveen Nazimudeen Date: Wed, 8 Jan 2025 18:08:20 -0500 Subject: [PATCH 5/6] fixed linting error --- exportoptions/appstore_options.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exportoptions/appstore_options.go b/exportoptions/appstore_options.go index f118c70c..73724e22 100644 --- a/exportoptions/appstore_options.go +++ b/exportoptions/appstore_options.go @@ -76,7 +76,8 @@ func (options AppStoreOptionsModel) Hash() map[string]interface{} { if options.Destination != "" { hash[DestinationKey] = options.Destination } - if options.TestFlightInternalTestingOnly != TestFlightInternalTestingOnlyDefault { + //if options.TestFlightInternalTestingOnly != TestFlightInternalTestingOnlyDefault { + if options.TestFlightInternalTestingOnly { hash[TestFlightInternalTestingOnlyKey] = options.TestFlightInternalTestingOnly } return hash From 2278c6c972ebc015156ac24b1e0bf4abe7b0bea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krisztia=CC=81n=20Go=CC=88drei?= Date: Thu, 9 Jan 2025 10:16:54 +0100 Subject: [PATCH 6/6] Update appstore_options.go --- exportoptions/appstore_options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exportoptions/appstore_options.go b/exportoptions/appstore_options.go index 73724e22..9eebcdd3 100644 --- a/exportoptions/appstore_options.go +++ b/exportoptions/appstore_options.go @@ -76,8 +76,8 @@ func (options AppStoreOptionsModel) Hash() map[string]interface{} { if options.Destination != "" { hash[DestinationKey] = options.Destination } - //if options.TestFlightInternalTestingOnly != TestFlightInternalTestingOnlyDefault { - if options.TestFlightInternalTestingOnly { + //nolint:gosimple + if options.TestFlightInternalTestingOnly != TestFlightInternalTestingOnlyDefault { hash[TestFlightInternalTestingOnlyKey] = options.TestFlightInternalTestingOnly } return hash