Question
How to test TeamCity Kotlin DSL? Is it possible to verify that the Kotlin DSL code produces a valid TeamCity configuration before merging it or pushing changes to the repository that stores Kotlin DSL settings?
Answer
The two most common ways are:
-
Generate XML locally (offline check)
- Run
mvn teamcity-configs:generatein the.teamcitydirectory (requires Maven). - The task compiles the Kotlin DSL, and writes the resulting XML files under
.teamcity/target. - Review the build output: compilation errors or stack-traces indicate problems in the DSL; the absence of errors means the settings are syntactically correct.
- Run
More details: Kotlin DSL - Generate XML Configuration Files Locally
- Use a local TeamCity server (real-life check)
Both methods are complementary: local XML generation is fastest for compile-time feedback, while a local server provides the same validation logic used in production.
Additional information
teamcity-configs:generate should perform config validation against the actual server state
Comments
0 comments
Please sign in to leave a comment.