Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set :poko-tests JVM toolchain version via CI #311

Merged
merged 9 commits into from
Feb 29, 2024

Conversation

drewhamilton
Copy link
Owner

@drewhamilton drewhamilton commented Feb 16, 2024

From my understanding of the errors on #258, calling jvmToolchain per-compilation in Kotlin Multiplatform is disallowed in Kotlin 2. This alternative makes the CI less efficient by needing to spin up more machines, but hopefully doesn't make it slower since the new machines are Ubuntu and will run in parallel to the main build. Happy to change the approach if there's a better way.

val classVersionRegex = Regex("class version [\\d.]* \\((\\d*)\\)")
val actualClassVersion = classVersionRegex.find(this)!!.groups.last()!!.value.toInt()
if (actualClassVersion < version) {
throw AssumptionViolatedException("This test only works class version $version+")
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a canonical way to do this within the assertk framework? It seemed like maybe I'd need a custom FailureContext but that's all internal.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drewhamilton
Copy link
Owner Author

This alternative makes the CI less efficient by needing to spin up more machines

Actually, it's more efficient now because we don't need to build the sample 4 times.

@drewhamilton drewhamilton merged commit dc36c09 into main Feb 29, 2024
5 checks passed
@drewhamilton drewhamilton deleted the drew/test-jvm-toolchain-version branch February 29, 2024 19:32
@JakeWharton
Copy link
Collaborator

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants