Skip to content

ci: run the Scala unit tests on pull requests - #26616

Merged
antobinary merged 2 commits into
bigbluebutton:v4.1.x-developfrom
imdt-claudiop:ci-scala-unit-tests
Nov 19, 2026
Merged

antobinary merged 2 commits into
bigbluebutton:v4.1.x-developfrom
imdt-claudiop:ci-scala-unit-tests

Conversation

@imdt-claudiop

@imdt-claudiop imdt-claudiop commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a GitHub Actions workflow, .github/workflows/scala-unit-tests.yml, that runs the unit tests of the three Scala server modules on every pull request that changes one of them: bbb-common-message, akka-bbb-apps and bbb-common-web. Until now no workflow ran sbt test, so these tests only ran when someone remembered to run them by hand.

The workflow installs JDK 21 (actions/setup-java, Temurin, with its sbt cache) and the sbt 1.10.7 runner (sbt/setup-sbt, with its sbt 2.x disk cache turned off) instead of relying on the runner image. It publishes the bbb-common-message snapshot locally (the other two modules depend on it), and then runs the tests of each module. Each module reports even when an earlier one fails, so a single red run shows all three results. The job has a 20 minute timeout, and a new push to the same pull request cancels the run in progress, as in automated-tests.yml. Otherwise it follows ts-code-compilation.yml: same trigger types, runner variable, read-only permissions and merge-ref checkout.

The package build scripts and the GitLab pipeline are unchanged. A failing test marks this check red; it does not block building packages. Like the build-package jobs, the check downloads sbt and the dependencies from Maven Central, so it can fail when Maven Central rate-limits the runner (HTTP 429); re-running the job is enough in that case.

To make the workflow useful from the first run, two fixes in bbb-common-message, which was the only one of the three modules whose tests could not run:

  • TestFixtures no longer matched the domain case classes (MeetingProp, BreakoutProps, DurationProps, WelcomeProp, UsersProp and DefaultProps gained or lost fields), so Test/compile failed with 9 errors and no test of the module ran. The fixture now builds every prop with the current constructors. It also passes userInactivityThresholdInMinutes where it used to pass the inspect timer value.
  • The module stays on ScalaTest 3.0.8, whose HTML reporter (-h) needs org.pegdown, which is not on the test classpath. Once the tests compiled, the run aborted with NoClassDefFoundError: org/pegdown/PegDownProcessor. The module now reports to stdout with durations (-oD), as akka-bbb-apps and bbb-common-web already do.

akka-bbb-apps and bbb-common-web pass as they are; their test configuration is not touched. The developer guide gets a short section on where these tests run and how to run them locally. No product code changes.

Closes Issue(s)

None.

Motivation

Server changes in these modules come with unit tests, but nothing checks them on pull requests, so a test can stay broken for a long time without anyone noticing. That is what happened to the bbb-common-message tests fixed here.

How to test

cd bbb-common-message && sbt publishLocal test
cd ../akka-bbb-apps && sbt test
cd ../bbb-common-web && sbt test

Before this change, sbt test in bbb-common-message on v4.1.x-develop ends with [error] 9 errors found and (Test / compileIncremental) Compilation failed.

More

The tests of bigbluebutton-web (Gradle) are not part of this workflow.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 4

  • v3.0.x-release
  • v3.0.x-develop
  • v4.0.x-release
  • v4.0.x-develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f3474758-77e4-4ab7-9bef-59b0632eeed4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…rops

TestFixtures no longer matched the domain case classes (MeetingProp,
BreakoutProps, DurationProps, WelcomeProp, UsersProp and DefaultProps
gained or lost fields), so Test/compile failed and no test of the module
ran. The fixture now builds every prop with the current constructors, and
passes userInactivityThresholdInMinutes where it passed the inspect timer.
New workflow that runs the unit tests of bbb-common-message, akka-bbb-apps
and bbb-common-web when a pull request changes one of them. It installs
JDK 21 and the sbt 1.10.7 runner itself, publishes the bbb-common-message
snapshot locally and then runs each module's tests; every module reports
even when an earlier one fails. The package build scripts are unchanged,
so a failing test marks the check red without blocking the package build.

The ScalaTest 3.0.8 HTML reporter (-h) of bbb-common-message needs
org.pegdown, which is not on the test classpath, so it aborted the run with
NoClassDefFoundError. The module now reports to stdout (-oD), as
akka-bbb-apps and bbb-common-web do.

The developer guide says where these tests run and how to run them locally.
@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@imdt-claudiop
imdt-claudiop marked this pull request as ready for review November 19, 2026 05:49
@antobinary antobinary added this to the Release 4.1 milestone Nov 19, 2026
@antobinary

Copy link
Copy Markdown
Member

A candidate for backporting to v4.0.x-develop

@paultrudel paultrudel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this looks good to me. The run on the head (44460511506) passes 20, 80 and 75 tests. The rebuilt TestFixtures matches the current case classes in Meeting2x.scala, and the two values it drops are not used anywhere. The if: conditions on the last two steps do what the description says.

None of the points below blocks the merge:

  1. No run on the base branch. The workflow only triggers on pull_request, so setup-java saves its sbt cache under each PR's own ref, and a new PR can't restore it: every new PR downloads sbt and the dependencies from Maven Central again, which is the 429 risk the description mentions. It also means nothing runs after a merge, so two PRs that each pass alone can break Test/compile on the base branch together, and the next PR that touches these modules goes red for an unrelated reason. A push trigger for the v*.x-develop branches with the same paths would fix both (with the conditional checkout that ts-code-compilation.yml already has).
  2. Formatting. These modules set scalariformAutoformat := true, and the run log shows Reformatted 2 Scala sources ... (test) in bbb-common-message, one of them the TestFixtures.scala this PR rewrites. So following the new dev-guide section leaves unrelated changes in the working tree. Running sbt Test/scalariformFormat and committing at least TestFixtures.scala would avoid that. akka-bbb-apps (5 files) and bbb-common-web (1) have the same drift, which is not from this PR.
  3. Optional: publishLocal also builds the scaladoc and sources jars. If scaladoc fails, both later test steps are skipped and the run reports one failure instead of three. Turning off packageDoc/packageSrc publishing for that step would avoid it.
  4. Optional, for the dev guide or a follow-up: "The unit tests ... run on every pull request" doesn't mention that akka-bbb-apps excludes 10 test sources from Test/compile (BreakoutRoomsUtilSpec, GroupsChatTests, ReceivedJsonMsgHandlerTraitTests, ...) and bbb-common-web excludes RecMetaXmlHelperTests. A follow-up issue to repair them, as this PR does for bbb-common-message, would be worth having.

On the 4.0 backport: the two commits don't cherry-pick cleanly onto v4.0.x-develop. TestFixtures.scala conflicts because 4.0's UsersProp doesn't have allowModsToRequestCameraShare or hideUsersWithoutCamera, so the 4.0 PR needs its own fixture edit.

@antobinary
antobinary merged commit ea38e1f into bigbluebutton:v4.1.x-develop Nov 19, 2026
53 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.

3 participants