Skip to content

Commit

Permalink
Merge pull request #924 from MarathonLabs/fix/apple-test-type
Browse files Browse the repository at this point in the history
fix(apple): fix missing testType in ConfigurationFactory
  • Loading branch information
Malinskiy authored Apr 25, 2024
2 parents 59b9e32 + 5423973 commit b1f4fd6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class ConfigurationFactory(
resolvedApplication,
resolvedTestApplication,
resolvedExtraApplications,
resolvedDerivedDataDir
resolvedDerivedDataDir,
it.testType
).apply { validate() }
}
val optionalDevices = configuration.vendorConfiguration.devicesFile?.resolveAgainst(marathonfileDir)
Expand Down Expand Up @@ -120,7 +121,8 @@ class ConfigurationFactory(
resolvedApplication,
resolvedTestApplication,
resolvedExtraApplications,
resolvedDerivedDataDir
resolvedDerivedDataDir,
it.testType
).apply { validate() }
}
val optionalDevices = configuration.vendorConfiguration.devicesFile?.resolveAgainst(marathonfileDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.KotlinFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.malinskiy.marathon.config.serialization.yaml.SerializeModule
import com.malinskiy.marathon.config.vendor.apple.TestType

class IosConfigurationFactoryTest {
private val mockMarathonFileDir = File(ConfigurationFactoryTest::class.java.getResource("/fixture/config/ios").file)
Expand Down Expand Up @@ -87,5 +88,15 @@ class IosConfigurationFactoryTest {

val iosConfiguration = configuration.vendorConfiguration as VendorConfiguration.IOSConfiguration
iosConfiguration.rsync.remotePath shouldBeEqualTo "/usr/bin/rsync"
iosConfiguration.bundle?.testType shouldBeEqualTo TestType.XCUITEST
}

@Test
fun `on configuration with xctest type specified`() {
val file = File(ConfigurationFactoryTest::class.java.getResource("/fixture/config/ios/sample_3.yaml").file)
val configuration = parser.parse(file)

val iosConfiguration = configuration.vendorConfiguration as VendorConfiguration.IOSConfiguration
iosConfiguration.bundle?.testType shouldBeEqualTo TestType.XCUITEST
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ vendorConfiguration:
type: "iOS"
bundle:
derivedDataDir: "derivedDataDir"
testType: xcuitest
ssh:
authentication:
type: "publicKey"
Expand Down

0 comments on commit b1f4fd6

Please sign in to comment.