From 7c1a512fc1b72928332d0d60f1654ab55ba1aa2d Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Thu, 25 Jan 2024 12:50:23 +0100 Subject: [PATCH 1/8] Enable clean checkout on teamcity --- .teamcity/settings.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index e5a8c24d2..1037bd2d7 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -70,6 +70,8 @@ object Examples : BuildType({ vcs { root(DslContext.settingsRoot, "+:. => imod-python") root(AbsoluteId("iMOD6_IMODPython_MetaSwapLookupTable"), ". => lookup_table") + + cleanCheckout = true } steps { @@ -137,6 +139,8 @@ object Lint : BuildType({ vcs { root(DslContext.settingsRoot, "+:. => imod-python") + + cleanCheckout = true } steps { @@ -241,6 +245,8 @@ object UnitTests : BuildType({ vcs { root(DslContext.settingsRoot, "+:. => imod-python") + + cleanCheckout = true } steps { From a712283f72f601af1d0a196c8cfec01d765f804f Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 11:35:15 +0100 Subject: [PATCH 2/8] Add nightly project --- .teamcity/settings.kts | 228 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 1037bd2d7..8866eb8f8 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -41,6 +41,8 @@ project { buildType(Lint) buildType(Tests) + subProject(Nightly) + features { buildTypeCustomChart { id = "PROJECT_EXT_41" @@ -325,3 +327,229 @@ object UnitTests : BuildType({ equals("env.OS", "Windows_NT") } }) + +object Nightly : Project({ + name = "Nightly" + + buildType(NightlyLint) + buildType(NightlyUnitTests) + buildType(NightlyExamples) + buildType(NightlyTests) +}) + +object NightlyLint : BuildType({ + name = "Lint" + + detectHangingBuilds = false + + vcs { + root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python") + } + + steps { + exec { + name = "Static code analysis" + id = "Static_code_analysis" + workingDir = "imod-python" + path = "pixi" + arguments = "run --frozen lint" + formatStderrAsError = true + param("script.content", "pixi run lint") + } + } + + features { + commitStatusPublisher { + vcsRootExtId = "iMOD6_IMODPython_ImodPython" + publisher = github { + githubUrl = "https://api.github.com" + authType = personalToken { + token = "zxx405f832770c7eeafe3bc4661cb60c2319d28aed5b8b69ab115b35746b5d73b63514210dbd32edbe1775d03cbe80d301b" + } + } + } + } + + requirements { + equals("env.OS", "Windows_NT") + } +}) + +object NightlyUnitTests : BuildType({ + name = "UnitTests" + + allowExternalStatus = true + artifactRules = """ + imod-python\imod\tests\temp => test_output.zip + imod-python\imod\tests\coverage => coverage.zip + """.trimIndent() + + vcs { + root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python") + + cleanCheckout = true + } + + steps { + script { + name = "Run unittests" + id = "Run_unittests" + workingDir = "imod-python" + scriptContent = """ + set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path% + pixi run --frozen unittests + """.trimIndent() + formatStderrAsError = true + } + powerShell { + name = "Extract coverage statistics" + id = "Extract_coverage_statistics" + workingDir = "imod-python/imod/tests" + scriptMode = script { + content = """ + ${'$'}REPORT = echo "coverage report" | pixi shell + + ${'$'}TOTALS = ${'$'}REPORT | Select-String -Pattern 'TOTAL' -CaseSensitive -SimpleMatch + ${'$'}STATISTICS = ${'$'}TOTALS -split "\s+" + ${'$'}TOTALLINES = ${'$'}STATISTICS[1] + ${'$'}MISSEDLINES = ${'$'}STATISTICS[2] + ${'$'}COVEREDLINES = ${'$'}TOTALLINES - ${'$'}MISSEDLINES + + Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='${'$'}COVEREDLINES']" + Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='${'$'}TOTALLINES']" + """.trimIndent() + } + } + } + + features { + xmlReport { + reportType = XmlReport.XmlReportType.JUNIT + rules = "imod-python/imod/tests/*report.xml" + } + } + + dependencies { + snapshot(NightlyLint) { + onDependencyFailure = FailureAction.FAIL_TO_START + } + dependency(AbsoluteId("iMOD6_Modflow6buildWin64")) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "+:MODFLOW6.zip!** => modflow6" + } + } + } + + requirements { + equals("env.OS", "Windows_NT") + } +}) + +object NightlyTests : BuildType({ + name = "Tests" + + allowExternalStatus = true + type = BuildTypeSettings.Type.COMPOSITE + + vcs { + root(AbsoluteId("iMOD6_IMODPython_ImodPython")) + + branchFilter = """ + +:* + -:release_imod56 + """.trimIndent() + showDependenciesChanges = true + } + + triggers { + finishBuildTrigger { + buildType = "iMOD6_Modflow6buildWin64" + successfulOnly = true + } + } + + features { + notifications { + notifierSettings = emailNotifier { + email = """ + joeri.vanengelen@deltares.nl + luitjan.slooten@deltares.nl + sunny.titus@deltares.nl + """.trimIndent() + } + buildFailedToStart = true + buildFailed = true + } + } + + dependencies { + snapshot(NightlyExamples) { + onDependencyFailure = FailureAction.FAIL_TO_START + } + dependency(NightlyUnitTests) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "+:coverage.zip => ." + } + } + } +}) + +object NightlyExamples : BuildType({ + name = "Examples" + + artifactRules = """imod-python\imod\tests\temp => test_output.zip""" + + vcs { + root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python") + root(AbsoluteId("iMOD6_IMODPython_MetaSwapLookupTable"), ". => lookup_table") + + cleanCheckout = true + } + + steps { + script { + name = "Run examples" + id = "Run_examples" + workingDir = "imod-python" + scriptContent = """ + set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path% + pixi run --frozen examples + """.trimIndent() + formatStderrAsError = true + } + } + + features { + xmlReport { + reportType = XmlReport.XmlReportType.JUNIT + rules = "imod-python/imod/tests/*report.xml" + } + } + + dependencies { + snapshot(NightlyLint) { + onDependencyFailure = FailureAction.FAIL_TO_START + } + dependency(AbsoluteId("iMOD6_Modflow6buildWin64")) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "+:MODFLOW6.zip!** => modflow6" + } + } + } + + requirements { + equals("env.OS", "Windows_NT") + } +}) \ No newline at end of file From 5ac7cdf30c627ccb5fbda61f902e111898e1009d Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 13:10:43 +0100 Subject: [PATCH 3/8] Move common code into templates --- .teamcity/settings.kts | 277 ++++++++++++++++------------------------- 1 file changed, 104 insertions(+), 173 deletions(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 8866eb8f8..b34b5a13b 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -41,7 +41,8 @@ project { buildType(Lint) buildType(Tests) - subProject(Nightly) + template(LintTemplate) + template(UnitTestsTemplate) features { buildTypeCustomChart { @@ -62,10 +63,92 @@ project { sourceBuildBranchFilter = "+:" } } + + subProject(Nightly) } -object Examples : BuildType({ - name = "Examples" +object LintTemplate : Template({ + name = "LintTemplate" + + detectHangingBuilds = false + + vcs { + root(DslContext.settingsRoot, "+:. => imod-python") + + cleanCheckout = true + } + + steps { + exec { + name = "Static code analysis" + id = "Static_code_analysis" + workingDir = "imod-python" + path = "pixi" + arguments = "run --frozen lint" + formatStderrAsError = true + param("script.content", "pixi run lint") + } + } + + requirements { + equals("env.OS", "Windows_NT") + } +}) + +object UnitTestsTemplate : Template({ + name = "UnitTestsTemplate" + + allowExternalStatus = true + artifactRules = """ + imod-python\imod\tests\temp => test_output.zip + imod-python\imod\tests\coverage => coverage.zip + """.trimIndent() + + vcs { + root(DslContext.settingsRoot, "+:. => imod-python") + + cleanCheckout = true + } + + steps { + script { + name = "Run unittests" + id = "Run_unittests" + workingDir = "imod-python" + scriptContent = """ + set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path% + pixi run --frozen unittests + """.trimIndent() + formatStderrAsError = true + } + powerShell { + name = "Extract coverage statistics" + id = "Extract_coverage_statistics" + workingDir = "imod-python/imod/tests" + scriptMode = script { + content = """ + ${'$'}REPORT = echo "coverage report" | pixi shell + + ${'$'}TOTALS = ${'$'}REPORT | Select-String -Pattern 'TOTAL' -CaseSensitive -SimpleMatch + ${'$'}STATISTICS = ${'$'}TOTALS -split "\s+" + ${'$'}TOTALLINES = ${'$'}STATISTICS[1] + ${'$'}MISSEDLINES = ${'$'}STATISTICS[2] + ${'$'}COVEREDLINES = ${'$'}TOTALLINES - ${'$'}MISSEDLINES + + Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='${'$'}COVEREDLINES']" + Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='${'$'}TOTALLINES']" + """.trimIndent() + } + } + } + + requirements { + equals("env.OS", "Windows_NT") + } +}) + +object ExamplesTemplate : Template({ + name = "ExamplesTemplate" artifactRules = """imod-python\imod\tests\temp => test_output.zip""" @@ -89,6 +172,16 @@ object Examples : BuildType({ } } + requirements { + equals("env.OS", "Windows_NT") + } +}) + +object Examples : BuildType({ + name = "Examples" + + templates(LintTemplate) + features { commitStatusPublisher { vcsRootExtId = "${DslContext.settingsRoot.id}" @@ -128,34 +221,12 @@ object Examples : BuildType({ onDependencyFailure = FailureAction.FAIL_TO_START } } - - requirements { - equals("env.OS", "Windows_NT") - } }) object Lint : BuildType({ name = "Lint" - detectHangingBuilds = false - - vcs { - root(DslContext.settingsRoot, "+:. => imod-python") - - cleanCheckout = true - } - - steps { - exec { - name = "Static code analysis" - id = "Static_code_analysis" - workingDir = "imod-python" - path = "pixi" - arguments = "run --frozen lint" - formatStderrAsError = true - param("script.content", "pixi run lint") - } - } + templates(LintTemplate) features { commitStatusPublisher { @@ -177,17 +248,13 @@ object Lint : BuildType({ } } } - - requirements { - equals("env.OS", "Windows_NT") - } }) object Tests : BuildType({ name = "Tests" allowExternalStatus = true - type = BuildTypeSettings.Type.COMPOSITE + type = Type.COMPOSITE vcs { root(DslContext.settingsRoot) @@ -239,49 +306,7 @@ object Tests : BuildType({ object UnitTests : BuildType({ name = "UnitTests" - allowExternalStatus = true - artifactRules = """ - imod-python\imod\tests\temp => test_output.zip - imod-python\imod\tests\coverage => coverage.zip - """.trimIndent() - - vcs { - root(DslContext.settingsRoot, "+:. => imod-python") - - cleanCheckout = true - } - - steps { - script { - name = "Run unittests" - id = "Run_unittests" - workingDir = "imod-python" - scriptContent = """ - set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path% - pixi run --frozen unittests - """.trimIndent() - formatStderrAsError = true - } - powerShell { - name = "Extract coverage statistics" - id = "Extract_coverage_statistics" - workingDir = "imod-python/imod/tests" - scriptMode = script { - content = """ - ${'$'}REPORT = echo "coverage report" | pixi shell - - ${'$'}TOTALS = ${'$'}REPORT | Select-String -Pattern 'TOTAL' -CaseSensitive -SimpleMatch - ${'$'}STATISTICS = ${'$'}TOTALS -split "\s+" - ${'$'}TOTALLINES = ${'$'}STATISTICS[1] - ${'$'}MISSEDLINES = ${'$'}STATISTICS[2] - ${'$'}COVEREDLINES = ${'$'}TOTALLINES - ${'$'}MISSEDLINES - - Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='${'$'}COVEREDLINES']" - Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='${'$'}TOTALLINES']" - """.trimIndent() - } - } - } + templates(UnitTestsTemplate) features { commitStatusPublisher { @@ -322,10 +347,6 @@ object UnitTests : BuildType({ onDependencyFailure = FailureAction.FAIL_TO_START } } - - requirements { - equals("env.OS", "Windows_NT") - } }) object Nightly : Project({ @@ -340,23 +361,7 @@ object Nightly : Project({ object NightlyLint : BuildType({ name = "Lint" - detectHangingBuilds = false - - vcs { - root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python") - } - - steps { - exec { - name = "Static code analysis" - id = "Static_code_analysis" - workingDir = "imod-python" - path = "pixi" - arguments = "run --frozen lint" - formatStderrAsError = true - param("script.content", "pixi run lint") - } - } + templates(LintTemplate) features { commitStatusPublisher { @@ -364,63 +369,17 @@ object NightlyLint : BuildType({ publisher = github { githubUrl = "https://api.github.com" authType = personalToken { - token = "zxx405f832770c7eeafe3bc4661cb60c2319d28aed5b8b69ab115b35746b5d73b63514210dbd32edbe1775d03cbe80d301b" + token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" } } } } - - requirements { - equals("env.OS", "Windows_NT") - } }) object NightlyUnitTests : BuildType({ name = "UnitTests" - allowExternalStatus = true - artifactRules = """ - imod-python\imod\tests\temp => test_output.zip - imod-python\imod\tests\coverage => coverage.zip - """.trimIndent() - - vcs { - root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python") - - cleanCheckout = true - } - - steps { - script { - name = "Run unittests" - id = "Run_unittests" - workingDir = "imod-python" - scriptContent = """ - set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path% - pixi run --frozen unittests - """.trimIndent() - formatStderrAsError = true - } - powerShell { - name = "Extract coverage statistics" - id = "Extract_coverage_statistics" - workingDir = "imod-python/imod/tests" - scriptMode = script { - content = """ - ${'$'}REPORT = echo "coverage report" | pixi shell - - ${'$'}TOTALS = ${'$'}REPORT | Select-String -Pattern 'TOTAL' -CaseSensitive -SimpleMatch - ${'$'}STATISTICS = ${'$'}TOTALS -split "\s+" - ${'$'}TOTALLINES = ${'$'}STATISTICS[1] - ${'$'}MISSEDLINES = ${'$'}STATISTICS[2] - ${'$'}COVEREDLINES = ${'$'}TOTALLINES - ${'$'}MISSEDLINES - - Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='${'$'}COVEREDLINES']" - Write-Host "##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='${'$'}TOTALLINES']" - """.trimIndent() - } - } - } + templates(UnitTestsTemplate) features { xmlReport { @@ -443,17 +402,13 @@ object NightlyUnitTests : BuildType({ } } } - - requirements { - equals("env.OS", "Windows_NT") - } }) object NightlyTests : BuildType({ name = "Tests" allowExternalStatus = true - type = BuildTypeSettings.Type.COMPOSITE + type = Type.COMPOSITE vcs { root(AbsoluteId("iMOD6_IMODPython_ImodPython")) @@ -505,27 +460,7 @@ object NightlyTests : BuildType({ object NightlyExamples : BuildType({ name = "Examples" - artifactRules = """imod-python\imod\tests\temp => test_output.zip""" - - vcs { - root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python") - root(AbsoluteId("iMOD6_IMODPython_MetaSwapLookupTable"), ". => lookup_table") - - cleanCheckout = true - } - - steps { - script { - name = "Run examples" - id = "Run_examples" - workingDir = "imod-python" - scriptContent = """ - set Path=%system.teamcity.build.checkoutDir%\modflow6;%env.Path% - pixi run --frozen examples - """.trimIndent() - formatStderrAsError = true - } - } + templates(LintTemplate) features { xmlReport { @@ -548,8 +483,4 @@ object NightlyExamples : BuildType({ } } } - - requirements { - equals("env.OS", "Windows_NT") - } }) \ No newline at end of file From 5e02ef6d1844b8e3a9928782ed83b5b77bed8a0c Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 13:15:38 +0100 Subject: [PATCH 4/8] Change lint build step to script --- .teamcity/settings.kts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index b34b5a13b..2b9d32a0c 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -79,14 +79,14 @@ object LintTemplate : Template({ } steps { - exec { - name = "Static code analysis" - id = "Static_code_analysis" - workingDir = "imod-python" - path = "pixi" - arguments = "run --frozen lint" - formatStderrAsError = true - param("script.content", "pixi run lint") + script { + name = "Static code analysis" + id = "Static_code_analysis" + workingDir = "imod-python" + scriptContent = """ + pixi run --frozen lint + """.trimIndent() + formatStderrAsError = true } } From 7b425a3e50566737db314ff9e2e6f3c66164148a Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 13:38:56 +0100 Subject: [PATCH 5/8] Create GitHubIntegration template --- .teamcity/settings.kts | 104 ++++++++++++----------------------------- 1 file changed, 31 insertions(+), 73 deletions(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 2b9d32a0c..2e926ab30 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -41,8 +41,10 @@ project { buildType(Lint) buildType(Tests) + template(GitHubIntegrationTemplate) template(LintTemplate) template(UnitTestsTemplate) + template(ExamplesTemplate) features { buildTypeCustomChart { @@ -67,6 +69,31 @@ project { subProject(Nightly) } +object GitHubIntegrationTemplate : Template({ + name = "GitHubIntegrationTemplate" + + features { + commitStatusPublisher { + vcsRootExtId = "${DslContext.settingsRoot.id}" + publisher = github { + githubUrl = "https://api.github.com" + authType = personalToken { + token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" + } + } + } + pullRequests { + vcsRootExtId = "${DslContext.settingsRoot.id}" + provider = github { + authType = token { + token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" + } + filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER + } + } + } +}) + object LintTemplate : Template({ name = "LintTemplate" @@ -180,31 +207,13 @@ object ExamplesTemplate : Template({ object Examples : BuildType({ name = "Examples" - templates(LintTemplate) + templates(ExamplesTemplate, GitHubIntegrationTemplate) features { - commitStatusPublisher { - vcsRootExtId = "${DslContext.settingsRoot.id}" - publisher = github { - githubUrl = "https://api.github.com" - authType = personalToken { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - } - } xmlReport { reportType = XmlReport.XmlReportType.JUNIT rules = "imod-python/imod/tests/*report.xml" } - pullRequests { - vcsRootExtId = "${DslContext.settingsRoot.id}" - provider = github { - authType = token { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER - } - } } dependencies { @@ -226,28 +235,7 @@ object Examples : BuildType({ object Lint : BuildType({ name = "Lint" - templates(LintTemplate) - - features { - commitStatusPublisher { - vcsRootExtId = "${DslContext.settingsRoot.id}" - publisher = github { - githubUrl = "https://api.github.com" - authType = personalToken { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - } - } - pullRequests { - vcsRootExtId = "${DslContext.settingsRoot.id}" - provider = github { - authType = token { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER - } - } - } + templates(LintTemplate, GitHubIntegrationTemplate) }) object Tests : BuildType({ @@ -306,31 +294,13 @@ object Tests : BuildType({ object UnitTests : BuildType({ name = "UnitTests" - templates(UnitTestsTemplate) + templates(UnitTestsTemplate, GitHubIntegrationTemplate) features { - commitStatusPublisher { - vcsRootExtId = "${DslContext.settingsRoot.id}" - publisher = github { - githubUrl = "https://api.github.com" - authType = personalToken { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - } - } xmlReport { reportType = XmlReport.XmlReportType.JUNIT rules = "imod-python/imod/tests/*report.xml" } - pullRequests { - vcsRootExtId = "${DslContext.settingsRoot.id}" - provider = github { - authType = token { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER - } - } } dependencies { @@ -362,18 +332,6 @@ object NightlyLint : BuildType({ name = "Lint" templates(LintTemplate) - - features { - commitStatusPublisher { - vcsRootExtId = "iMOD6_IMODPython_ImodPython" - publisher = github { - githubUrl = "https://api.github.com" - authType = personalToken { - token = "credentialsJSON:558df52e-822f-4d9d-825a-854846a9a2ff" - } - } - } - } }) object NightlyUnitTests : BuildType({ @@ -460,7 +418,7 @@ object NightlyTests : BuildType({ object NightlyExamples : BuildType({ name = "Examples" - templates(LintTemplate) + templates(ExamplesTemplate) features { xmlReport { From 6031ed0dea89045d5d79269413a3b0b11be4c64b Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 14:36:13 +0100 Subject: [PATCH 6/8] Removal of some more duplicate code --- .teamcity/settings.kts | 43 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 2e926ab30..f9d6b9213 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -2,7 +2,6 @@ import jetbrains.buildServer.configs.kotlin.* import jetbrains.buildServer.configs.kotlin.CustomChart.Serie import jetbrains.buildServer.configs.kotlin.CustomChart.SeriesKey import jetbrains.buildServer.configs.kotlin.buildFeatures.* -import jetbrains.buildServer.configs.kotlin.buildSteps.exec import jetbrains.buildServer.configs.kotlin.buildSteps.powerShell import jetbrains.buildServer.configs.kotlin.buildSteps.script import jetbrains.buildServer.configs.kotlin.projectFeatures.ProjectReportTab @@ -169,6 +168,13 @@ object UnitTestsTemplate : Template({ } } + features { + xmlReport { + reportType = XmlReport.XmlReportType.JUNIT + rules = "imod-python/imod/tests/*report.xml" + } + } + requirements { equals("env.OS", "Windows_NT") } @@ -199,6 +205,13 @@ object ExamplesTemplate : Template({ } } + features { + xmlReport { + reportType = XmlReport.XmlReportType.JUNIT + rules = "imod-python/imod/tests/*report.xml" + } + } + requirements { equals("env.OS", "Windows_NT") } @@ -209,13 +222,6 @@ object Examples : BuildType({ templates(ExamplesTemplate, GitHubIntegrationTemplate) - features { - xmlReport { - reportType = XmlReport.XmlReportType.JUNIT - rules = "imod-python/imod/tests/*report.xml" - } - } - dependencies { dependency(AbsoluteId("MetaSWAP_Modflow_Modflow6Release642")) { snapshot { @@ -296,13 +302,6 @@ object UnitTests : BuildType({ templates(UnitTestsTemplate, GitHubIntegrationTemplate) - features { - xmlReport { - reportType = XmlReport.XmlReportType.JUNIT - rules = "imod-python/imod/tests/*report.xml" - } - } - dependencies { dependency(AbsoluteId("MetaSWAP_Modflow_Modflow6Release642")) { snapshot { @@ -339,13 +338,6 @@ object NightlyUnitTests : BuildType({ templates(UnitTestsTemplate) - features { - xmlReport { - reportType = XmlReport.XmlReportType.JUNIT - rules = "imod-python/imod/tests/*report.xml" - } - } - dependencies { snapshot(NightlyLint) { onDependencyFailure = FailureAction.FAIL_TO_START @@ -420,13 +412,6 @@ object NightlyExamples : BuildType({ templates(ExamplesTemplate) - features { - xmlReport { - reportType = XmlReport.XmlReportType.JUNIT - rules = "imod-python/imod/tests/*report.xml" - } - } - dependencies { snapshot(NightlyLint) { onDependencyFailure = FailureAction.FAIL_TO_START From 4016c0253befd1c6baed36dfee6fbf678f029151 Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 14:44:18 +0100 Subject: [PATCH 7/8] Sorting of build configuration --- .teamcity/settings.kts | 96 +++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index f9d6b9213..1690b52de 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -217,10 +217,16 @@ object ExamplesTemplate : Template({ } }) -object Examples : BuildType({ - name = "Examples" +object Lint : BuildType({ + name = "Lint" - templates(ExamplesTemplate, GitHubIntegrationTemplate) + templates(LintTemplate, GitHubIntegrationTemplate) +}) + +object UnitTests : BuildType({ + name = "UnitTests" + + templates(UnitTestsTemplate, GitHubIntegrationTemplate) dependencies { dependency(AbsoluteId("MetaSWAP_Modflow_Modflow6Release642")) { @@ -238,10 +244,25 @@ object Examples : BuildType({ } }) -object Lint : BuildType({ - name = "Lint" +object Examples : BuildType({ + name = "Examples" - templates(LintTemplate, GitHubIntegrationTemplate) + templates(ExamplesTemplate, GitHubIntegrationTemplate) + + dependencies { + dependency(AbsoluteId("MetaSWAP_Modflow_Modflow6Release642")) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "+:MODFLOW6.zip!** => modflow6" + } + } + snapshot(Lint) { + onDependencyFailure = FailureAction.FAIL_TO_START + } + } }) object Tests : BuildType({ @@ -297,27 +318,6 @@ object Tests : BuildType({ } }) -object UnitTests : BuildType({ - name = "UnitTests" - - templates(UnitTestsTemplate, GitHubIntegrationTemplate) - - dependencies { - dependency(AbsoluteId("MetaSWAP_Modflow_Modflow6Release642")) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "+:MODFLOW6.zip!** => modflow6" - } - } - snapshot(Lint) { - onDependencyFailure = FailureAction.FAIL_TO_START - } - } -}) - object Nightly : Project({ name = "Nightly" @@ -354,6 +354,27 @@ object NightlyUnitTests : BuildType({ } }) +object NightlyExamples : BuildType({ + name = "Examples" + + templates(ExamplesTemplate) + + dependencies { + snapshot(NightlyLint) { + onDependencyFailure = FailureAction.FAIL_TO_START + } + dependency(AbsoluteId("iMOD6_Modflow6buildWin64")) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + } + + artifacts { + artifactRules = "+:MODFLOW6.zip!** => modflow6" + } + } + } +}) + object NightlyTests : BuildType({ name = "Tests" @@ -405,25 +426,4 @@ object NightlyTests : BuildType({ } } } -}) - -object NightlyExamples : BuildType({ - name = "Examples" - - templates(ExamplesTemplate) - - dependencies { - snapshot(NightlyLint) { - onDependencyFailure = FailureAction.FAIL_TO_START - } - dependency(AbsoluteId("iMOD6_Modflow6buildWin64")) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - } - - artifacts { - artifactRules = "+:MODFLOW6.zip!** => modflow6" - } - } - } }) \ No newline at end of file From ff4d8c0e6322266143d6adf6c96b51d610d34b06 Mon Sep 17 00:00:00 2001 From: Sunny Titus Date: Fri, 26 Jan 2024 14:49:03 +0100 Subject: [PATCH 8/8] Remove wrong trigger --- .teamcity/settings.kts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 1690b52de..a61ce767b 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -281,15 +281,6 @@ object Tests : BuildType({ showDependenciesChanges = true } - triggers { - finishBuildTrigger { - buildType = "iMOD6_Modflow6buildWin64" - successfulOnly = true - } - vcs { - } - } - features { pullRequests { vcsRootExtId = "${DslContext.settingsRoot.id}"