Skip to content

fix: stabilize Kotlin, Scala, and Rust runtime tests#2415

Merged
jonaslagoni merged 8 commits intoasyncapi:masterfrom
Varadraj75:fix/runtime-tests-and-docker-builds
Jan 20, 2026
Merged

fix: stabilize Kotlin, Scala, and Rust runtime tests#2415
jonaslagoni merged 8 commits intoasyncapi:masterfrom
Varadraj75:fix/runtime-tests-and-docker-builds

Conversation

@Varadraj75
Copy link
Contributor

Description

This PR stabilizes the Kotlin, Scala, and Rust runtime tests which were failing in clean local environments and inside Docker/CI.

It fixes multiple root causes, including:

  • Enforcing Java 17 for Gradle-based runtime tests
  • Fixing missing or incorrect code generation before builds
  • Correcting Scala enum rendering issues
  • Removing hardcoded cargo path in Rust runtime tests
  • Updating Gradle wrapper configuration to avoid class file version errors

After these changes, all runtime tests pass consistently both locally and in Docker.

Related Issue

Closes: #2414

Checklist

  • The code follows the project's coding standards and is properly linted (npm run lint).
  • Tests have been added or updated to cover the changes.
  • Documentation has been updated to reflect the changes.
  • All tests pass successfully locally.(npm run test).

Additional Notes

This PR was tested on macOS with Node v24 and Java 17.

The following commands now pass successfully:

npm run test:runtime:kotlin
npm run test:runtime:scala
npm run test:runtime:rust
npm test

Copilot AI review requested due to automatic review settings January 19, 2026 12:46
@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit b0578e3
🔍 Latest deploy log https://app.netlify.com/projects/modelina/deploys/696e340814a97c0008a99116

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR stabilizes Kotlin, Scala, and Rust runtime tests by fixing multiple issues that prevented them from running consistently in clean environments and CI/CD pipelines.

Changes:

  • Fixed import paths in runtime test generators to use correct module references
  • Upgraded Gradle wrapper to version 8.5 for better Java 17 compatibility
  • Added code generation steps before build/test execution in Kotlin and Scala tests
  • Enhanced Scala enum type handling to properly reference enum values
  • Made Rust tests more flexible with configurable cargo path
  • Updated test timeouts and added stderr tolerance for noisy build outputs

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/runtime/runtime-scala/src/test/scala/com/mycompany/app/generic/AddressSpec.scala Updated test data to match generated code structure with correct types and optional enum fields
test/runtime/runtime-scala.ts Fixed import path from '../..' to '../../src' for proper module resolution
test/runtime/runtime-scala.spec.ts Added code generation step, increased timeout, and enabled stderr output
test/runtime/runtime-rust/Cargo.toml Removed unnecessary bin and test configurations for library project
test/runtime/runtime-rust.spec.ts Added configurable cargo path via environment variable and enabled stderr output
test/runtime/runtime-kotlin/src/test/kotlin/com/mycompany/app/generic/AddressTest.kt Updated test to use correct types and standalone NestedObject class, added missing import
test/runtime/runtime-kotlin/gradle/wrapper/gradle-wrapper.properties Upgraded Gradle from 4.4.1 to 8.5 for Java 17 support
test/runtime/runtime-kotlin/build.gradle Added Jackson and Hamcrest dependencies required by tests
test/runtime/runtime-kotlin.ts Fixed import path from '../../' to '../../src' for proper module resolution
test/runtime/runtime-kotlin.spec.ts Added code generation step, increased timeout, and enabled stderr output
src/generators/scala/ScalaConstrainer.ts Enhanced Reference type mapping to handle enum references by appending '.Value'
Dockerfile Removed deprecated apt-key commands for mono installation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link

coveralls commented Jan 19, 2026

Pull Request Test Coverage Report for Build 21139599147

Details

  • 3 of 4 (75.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 90.997%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/generators/scala/ScalaConstrainer.ts 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
src/generators/rust/RustConstrainer.ts 1 94.38%
Totals Coverage Status
Change from base Build 21131896077: -0.03%
Covered Lines: 6942
Relevant Lines: 7421

💛 - Coveralls

Varadraj75 and others added 4 commits January 19, 2026 18:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

@jonaslagoni jonaslagoni changed the title fix(runtime): stabilize Kotlin, Scala, and Rust runtime tests fix: stabilize Kotlin, Scala, and Rust runtime tests Jan 19, 2026
@jonaslagoni jonaslagoni merged commit 7fab703 into asyncapi:master Jan 20, 2026
21 checks passed
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.

[BUG] Runtime tests for Kotlin, Scala, and Rust fail locally and in Docker environment

3 participants