Skip to content

Commit e968028

Browse files
added testFlightInternalTestingOnly appStore option (#257)
* added testFlightInternalTestingOnly appStore option * Update bitrise.yml * Remove integration tests workflow * 1. Added TestFlightInternalTestingOnlyDefault 2. Added tests to check for TestFlightInternalTestingOnly in TestAppStoreOptionsToHash * fixed linting error * Update appstore_options.go --------- Co-authored-by: Krisztián Gödrei <[email protected]>
1 parent f1bfed7 commit e968028

File tree

4 files changed

+23
-103
lines changed

4 files changed

+23
-103
lines changed

bitrise.yml

Lines changed: 2 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
format_version: 1.0.0
1+
format_version: "11"
22
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
33

4-
app:
5-
envs:
6-
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR
7-
84
workflows:
9-
ci:
5+
check:
106
before_run:
117
- test
12-
- swiftpm_cache
138

149
test:
15-
after_run:
16-
- integration-test
1710
steps:
1811
- git::https://github.com/bitrise-steplib/steps-check.git:
1912
title: Lint
@@ -24,93 +17,3 @@ workflows:
2417
inputs:
2518
- exclude: "*/mocks"
2619
- go-test: { }
27-
28-
integration-test:
29-
steps:
30-
- script:
31-
title: Run integration tests
32-
inputs:
33-
- content: |-
34-
#!/bin/bash
35-
echo "Running integration tests ..."
36-
set -ex
37-
38-
go test -v ./_tests/integration/...
39-
40-
_swiftpm_step:
41-
envs:
42-
- CURRENT_PROJECT_PATH: $CURRENT_PROJECT_PATH
43-
- BITRISE_ACCESS_TOKEN: $BITRISE_ACCESS_TOKEN
44-
steps:
45-
- build-router-start:
46-
inputs:
47-
- workflows: swiftpm_run_xcodebuild
48-
- wait_for_builds: "true"
49-
- access_token: $BITRISE_ACCESS_TOKEN
50-
- environment_key_list: CURRENT_PROJECT_PATH
51-
- verbose: "yes"
52-
53-
swiftpm_run_xcodebuild:
54-
envs:
55-
- CURRENT_PROJECT_PATH: $CURRENT_PROJECT_PATH
56-
- SAMPLES_DIR: $ORIG_BITRISE_SOURCE_DIR/_checkout
57-
steps:
58-
- script:
59-
title: Cleanup $TMP_DIR
60-
inputs:
61-
- content: |
62-
#!/bin/bash
63-
set -ex
64-
65-
rm -rf $SAMPLES_DIR
66-
mkdir $SAMPLES_DIR
67-
git clone https://github.com/bitrise-io/sample-apps-ios-swiftpm.git -b master $SAMPLES_DIR
68-
69-
rm -rf /Users/lpusok/Library/Developer/Xcode/DerivedData/*
70-
- cache-pull:
71-
run_if: true
72-
inputs:
73-
- is_debug_mode: true
74-
- xcode-test:
75-
title: Run xcodebuild
76-
inputs:
77-
- project_path: $SAMPLES_DIR/$CURRENT_PROJECT_PATH/sample-swiftpm2.xcodeproj
78-
- scheme: sample-swiftpm2
79-
- cache_level: swift_packages
80-
- cache-push:
81-
title: Push cache
82-
run_if: true
83-
is_skippable: false
84-
inputs:
85-
- is_debug_mode: true
86-
87-
_swiftpm_step2:
88-
envs:
89-
- CURRENT_PROJECT_PATH: sample-swiftpm2
90-
after_run:
91-
- _swiftpm_step
92-
93-
_swiftpm_step3:
94-
envs:
95-
- CURRENT_PROJECT_PATH: sample-swiftpm3
96-
after_run:
97-
- _swiftpm_step
98-
99-
_swiftpm_step5:
100-
envs:
101-
- CURRENT_PROJECT_PATH: sample-swiftpm5
102-
after_run:
103-
- _swiftpm_step
104-
105-
_swiftpm_step7:
106-
envs:
107-
- CURRENT_PROJECT_PATH: sample-swiftpm7
108-
after_run:
109-
- _swiftpm_step
110-
111-
swiftpm_cache:
112-
after_run:
113-
- _swiftpm_step2
114-
- _swiftpm_step3
115-
- _swiftpm_step5
116-
- _swiftpm_step7

exportoptions/appstore_options.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ type AppStoreOptionsModel struct {
2222
UploadSymbols bool
2323
// Should Xcode manage the app's build number when uploading to App Store Connect? Defaults to YES.
2424
ManageAppVersion bool
25+
26+
TestFlightInternalTestingOnly bool
2527
}
2628

2729
// NewAppStoreOptions ...
2830
func NewAppStoreOptions() AppStoreOptionsModel {
2931
return AppStoreOptionsModel{
30-
UploadBitcode: UploadBitcodeDefault,
31-
UploadSymbols: UploadSymbolsDefault,
32-
ManageAppVersion: manageAppVersionDefault,
32+
UploadBitcode: UploadBitcodeDefault,
33+
UploadSymbols: UploadSymbolsDefault,
34+
ManageAppVersion: manageAppVersionDefault,
35+
TestFlightInternalTestingOnly: TestFlightInternalTestingOnlyDefault,
3336
}
3437
}
3538

@@ -73,6 +76,10 @@ func (options AppStoreOptionsModel) Hash() map[string]interface{} {
7376
if options.Destination != "" {
7477
hash[DestinationKey] = options.Destination
7578
}
79+
//nolint:gosimple
80+
if options.TestFlightInternalTestingOnly != TestFlightInternalTestingOnlyDefault {
81+
hash[TestFlightInternalTestingOnlyKey] = options.TestFlightInternalTestingOnly
82+
}
7683
return hash
7784
}
7885

exportoptions/exportoptions_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func TestNewAppStoreOptions(t *testing.T) {
111111
options := NewAppStoreOptions()
112112
require.Equal(t, UploadBitcodeDefault, options.UploadBitcode)
113113
require.Equal(t, UploadSymbolsDefault, options.UploadSymbols)
114+
require.Equal(t, TestFlightInternalTestingOnlyDefault, options.TestFlightInternalTestingOnly)
114115
}
115116
}
116117

@@ -136,9 +137,10 @@ func TestAppStoreOptionsToHash(t *testing.T) {
136137
options.UploadBitcode = false
137138
options.UploadSymbols = false
138139
options.ManageAppVersion = false
140+
options.TestFlightInternalTestingOnly = true
139141

140142
hash := options.Hash()
141-
require.Equal(t, 5, len(hash))
143+
require.Equal(t, 6, len(hash))
142144

143145
{
144146
value, ok := hash[MethodKey]
@@ -165,6 +167,11 @@ func TestAppStoreOptionsToHash(t *testing.T) {
165167
require.True(t, ok)
166168
require.Equal(t, false, value)
167169
}
170+
{
171+
value, ok := hash[TestFlightInternalTestingOnlyKey]
172+
require.True(t, ok)
173+
require.Equal(t, true, value)
174+
}
168175
}
169176
}
170177

exportoptions/properties.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ const (
177177

178178
const DestinationKey = "destination"
179179

180+
const TestFlightInternalTestingOnlyDefault = false
181+
const TestFlightInternalTestingOnlyKey = "testFlightInternalTestingOnly"
182+
180183
type Destination string
181184

182185
// Destination ...

0 commit comments

Comments
 (0)