Skip to content

Commit 825db06

Browse files
authored
Step 1212 ideal step refactor (#181)
* Ideal Step project structure. * Migrate from ExportEnvironmentWithEnvman to stepenv.Set migrate to logger, typo fixes. * Create xcodebuild package. * Create simulator package. * Create testaddon and testartifact packages. * Move Version func to xcodebuild package. * Create output package. * Create xcpretty package. * Create cache package. * Break AbsPath dependency. * Cleanup and unit test for Step.run. * Fix lint issues. * Cleanup. * Test xcodebuild package. * Update go-utils and go-xcode packages. * Go dependencies update and cleanup. * Move testsummaries package to testartifact. * Cache interface renamed to SwiftPackageCache. * Migrate to fileutils.FileRemover and introduce createStep. * simulator.InfoModel renamed to simulator.Info. * simulator.New renamed to simulator.NewSimulator. * Make simulator value receiver. * simulator renamed to defaultSimulator. * Merge consts in step.go. * Update test function name. * Make testartifact.Exporter value receiver. * Move test repetition and output tool related consts to xcodebuild. * Reorder xcodebuild's consts and vars. * Separate prepareSimulator func. * Merge Result and ExportOpts structs. * Break Step.Run into smaller functions. * Break ProcessConfig into smaller functions. * Fix lint and test issues. * Restore previous error handling for output export. * Rename simulator.Simulator to simulator.Manager. * Rename simulator.Info struct to simulator.Simulator and regenerate simulator package mocks. * Introduce createConfig and reorganise step.go. * Introduce createBuildParams and createTestParams. * Break ioutil.TempDir dependency. * Merge createTestParams and createTestRunParams. * Make sure clean is called once. * Rename simulator manager receiver.
1 parent e60d488 commit 825db06

File tree

176 files changed

+12864
-2693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+12864
-2693
lines changed

cache/cache.go

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package cache
2+
3+
import (
4+
xcodecache "github.com/bitrise-io/go-xcode/xcodecache"
5+
)
6+
7+
// SwiftPackageCache ...
8+
type SwiftPackageCache interface {
9+
SwiftPackagesPath(projectPth string) (string, error)
10+
CollectSwiftPackages(projectPath string) error
11+
}
12+
13+
type cache struct {
14+
}
15+
16+
// NewSwiftPackageCache ...
17+
func NewSwiftPackageCache() SwiftPackageCache {
18+
return &cache{}
19+
}
20+
21+
func (c cache) SwiftPackagesPath(projectPth string) (string, error) {
22+
return xcodecache.SwiftPackagesPath(projectPth)
23+
}
24+
25+
func (c cache) CollectSwiftPackages(projectPath string) error {
26+
return xcodecache.CollectSwiftPackages(projectPath)
27+
}

cache/mocks/Cache.go

+45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

command/command.go

-94
This file was deleted.

command/command_test.go

-45
This file was deleted.

go.mod

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ module github.com/bitrise-steplib/steps-xcode-test
33
go 1.16
44

55
require (
6-
github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1
7-
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1
8-
github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5
9-
github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b
10-
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
11-
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
6+
github.com/bitrise-io/bitrise v0.0.0-20210830100501-97b6f7d7905b
7+
github.com/bitrise-io/go-steputils v0.0.0-20210831050118-9a8de76b2f19
8+
github.com/bitrise-io/go-utils v0.0.0-20210903060322-ecae303f0264
9+
github.com/bitrise-io/go-xcode v0.0.0-20210901135441-4de33870e9ae
1210
github.com/hashicorp/go-version v1.3.0
1311
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
1412
github.com/stretchr/testify v1.7.0
15-
golang.org/x/sys v0.0.0-20210531080801-fdfd190a6549 // indirect
1613
)

go.sum

+22-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
2-
github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1 h1:PERqeGZZkMrGYSSN/Stk+YkhErgdk37aVqc5UgnIEoo=
3-
github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1/go.mod h1:Jqf2PLwOKL1bYdbQIhVkNd55YyYKJBXyY0EtlRg5uw4=
2+
github.com/bitrise-io/bitrise v0.0.0-20210830100501-97b6f7d7905b h1:F0CtuNChYcAbyr9EfA6tKwZ/19ucz6jWEf0TGtYRARA=
3+
github.com/bitrise-io/bitrise v0.0.0-20210830100501-97b6f7d7905b/go.mod h1:jqk9VdrvlRpRfIqA2DZHVNEMvPycmlpBfpiKxk89R6w=
44
github.com/bitrise-io/colorstring v0.0.0-20180614154802-a8cd70115192/go.mod h1:CIHVcxZUvsG99XUJV6JlR7okNsMMGY81jMvPC20W+O0=
55
github.com/bitrise-io/envman v0.0.0-20200512105748-919e33f391ee/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI=
6+
github.com/bitrise-io/envman v0.0.0-20210517135508-b2b4fe89eac5/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI=
67
github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA=
7-
github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w=
8-
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1 h1:gi29hTdxGXAGQvZckPZ9V8BAEfP3eK/tiZgTC5s6h1c=
9-
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w=
8+
github.com/bitrise-io/go-steputils v0.0.0-20210831050118-9a8de76b2f19 h1:ZLuZ7EqpV2mgxEZTZrWxFjDo8t0F576QQLyschuuJRE=
9+
github.com/bitrise-io/go-steputils v0.0.0-20210831050118-9a8de76b2f19/go.mod h1:deuDfnw5Hot7Uajr7gsM5hNKAlKS3iIAPpZgfZSDNOk=
1010
github.com/bitrise-io/go-utils v0.0.0-20210505091801-98b7dc39ee61/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA=
1111
github.com/bitrise-io/go-utils v0.0.0-20210505121718-07411d72e36e/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA=
12-
github.com/bitrise-io/go-utils v0.0.0-20210507100250-37de47dfa6ce/go.mod h1:15EZZf02noI5nWFqXMZEoyb1CyqYRXTMz5Fyu4CWFzI=
13-
github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5 h1:kclxBfygfNK6kWUB+9xcsfPLBen8Us9gubhitfL/Z6c=
1412
github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5/go.mod h1:DRx7oFuAqk0dbKpAKCqWl0TgrowfJUb/MqYPRscxJOQ=
15-
github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b h1:JyTlzvdOBOxtYZ7aZVCog2dZUv8LgA8UftT+TpVWtZY=
16-
github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b/go.mod h1:6Nv5RAsAVS745xN5IihUExVmCA9n9f7s/DSVow4hXrI=
13+
github.com/bitrise-io/go-utils v0.0.0-20210830144330-49d11743a4fd/go.mod h1:Vi4MHnaZVL3PVoPPA/Yp6g2pzntkDH8LGiRSY7qw6KQ=
14+
github.com/bitrise-io/go-utils v0.0.0-20210901122528-80582f68ed74 h1:zEcuic3XCiW16aDX/EII17WNljqA+Yg0Y3szG6ctAw0=
15+
github.com/bitrise-io/go-utils v0.0.0-20210901122528-80582f68ed74/go.mod h1:Vi4MHnaZVL3PVoPPA/Yp6g2pzntkDH8LGiRSY7qw6KQ=
16+
github.com/bitrise-io/go-utils v0.0.0-20210903060322-ecae303f0264 h1:luzJPS5Aww2ckMNQP7nCGDc7WfTLpzmWBqWr7SQyXJg=
17+
github.com/bitrise-io/go-utils v0.0.0-20210903060322-ecae303f0264/go.mod h1:Vi4MHnaZVL3PVoPPA/Yp6g2pzntkDH8LGiRSY7qw6KQ=
18+
github.com/bitrise-io/go-xcode v0.0.0-20210901135441-4de33870e9ae h1:FFdNRw1T7RXgAFVEIfqGBEqA6h0IiLYP8YM2qG9F6yA=
19+
github.com/bitrise-io/go-xcode v0.0.0-20210901135441-4de33870e9ae/go.mod h1:NlngqvT+c6BKwNGTc9eYZIter9EPSHmAxP7vvxLjUOs=
1720
github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo=
1821
github.com/bitrise-io/gows v0.0.0-20210505125306-dd92ff463938/go.mod h1:3Cp9ceJ8wHl1Av6oEE2ff1iWaYLliQuD+oaNdyM0NWQ=
1922
github.com/bitrise-io/pkcs12 v0.0.0-20210430063833-0da06eb56630/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU=
20-
github.com/bitrise-io/stepman v0.0.0-20210505110307-5c2296bcc558/go.mod h1:WLh58JYBgbD1Z/yyw1AkFz/90F6oBL0HS/luBpUW9dI=
23+
github.com/bitrise-io/stepman v0.0.0-20210517135458-203f7a48d37a/go.mod h1:WLh58JYBgbD1Z/yyw1AkFz/90F6oBL0HS/luBpUW9dI=
2124
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
2225
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
2326
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -56,6 +59,7 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE
5659
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
5760
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
5861
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
62+
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
5963
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
6064
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
6165
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@@ -67,8 +71,10 @@ github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgw
6771
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
6872
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
6973
golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
70-
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
7174
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
75+
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
76+
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
77+
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
7278
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
7379
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
7480
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -78,11 +84,13 @@ golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7w
7884
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7985
golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8086
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
81-
golang.org/x/sys v0.0.0-20210531080801-fdfd190a6549 h1:OL5GcZ2XPkte3dpfuFQ9o884vrE3BZQhajdntNMruv4=
82-
golang.org/x/sys v0.0.0-20210531080801-fdfd190a6549/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
87+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
88+
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
89+
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8390
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
84-
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
8591
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
92+
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
93+
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
8694
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
8795
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
8896
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=

inputs.go

-23
This file was deleted.

0 commit comments

Comments
 (0)