Skip to content

Commit

Permalink
Fixes #59 Add matrix to config merger logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ncipollo committed Oct 2, 2023
1 parent 95d38f0 commit 2380d75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/commonMain/kotlin/org/tix/config/merge/TixMerger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ fun RawTixConfiguration.merge(overlay: RawTixConfiguration) = RawTixConfiguratio
include = overlay.include,// We always want to take the top include
github = github?.merge(overlay.github) ?: overlay.github,
jira = jira?.merge(overlay.jira) ?: overlay.jira,
matrix = matrix + overlay.matrix,
variables = variables + overlay.variables,
variableToken = overlay.variableToken ?: variableToken
)
Expand Down
6 changes: 6 additions & 0 deletions src/commonTest/kotlin/org/tix/config/merge/TixMergerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TixMergerTest {
default = mapOf("jira$index" to DynamicElement(index))
)
).takeIf { index < 3 },
matrix = mapOf("matrix_$index" to listOf(DynamicElement("value_$index"))),
variables = mapOf("config$index" to "$index"),
variableToken = "$index"
)
Expand All @@ -44,6 +45,11 @@ class TixMergerTest {
)
)
),
matrix = mapOf(
"matrix_1" to listOf(DynamicElement("value_1")),
"matrix_2" to listOf(DynamicElement("value_2")),
"matrix_3" to listOf(DynamicElement("value_3"))
),
variables = mapOf(
"config1" to "1",
"config2" to "2",
Expand Down

0 comments on commit 2380d75

Please sign in to comment.