Skip to content

Fix the cargo-test and cargo-bench CI jobs not running#19883

Merged
anoadragon453 merged 8 commits into
developfrom
anoa/fix_rust_tests_ci
Jun 30, 2026
Merged

Fix the cargo-test and cargo-bench CI jobs not running#19883
anoadragon453 merged 8 commits into
developfrom
anoa/fix_rust_tests_ci

Conversation

@anoadragon453

@anoadragon453 anoadragon453 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Originally reported by @jason-famedly in #synapse-dev.

Previously the cargo-test and cargo-bench GitHub action jobs weren't running unless Synapse's README was also updated (due to workflow job dependency trees; see the code for an explanation).

After fixing that, there were several test failures that went uncaught in recent PRs. Those are fixed by the final commits.

Commits overview:

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

…obs are skipped

If the README was not edited, then `lint-readme` was skipped. Which, because these jobs depended on `linting-done`, which depends on `lint-readme`, would cause them to be skipped as well.
Otherwise we need to bump the MSRV to 1.96.0.
The rust layer had its strict canonicaljson checking relaxed in
#19816, which broke the rust
test. However, due to rust tests not running on PRs, this wasn't
noticed.

To keep the relaxed stance while ensuring we check canonicaljson for new
events in the python layer, the rust test was adjusted and a new python
test added instead.
Otherwise we'd get the following test failure:

---- events::tests::test_v4_validate_rejects_missing_room_id_for_non_create stdout ----

thread 'events::tests::test_v4_validate_rejects_missing_room_id_for_non_create' (2924904) panicked at rust/src/events/mod.rs:848:9:
assertion failed: event.specific_fields.validate(&event.common_fields).is_err()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@anoadragon453 anoadragon453 marked this pull request as ready for review June 30, 2026 10:14
@anoadragon453 anoadragon453 requested a review from a team as a code owner June 30, 2026 10:14
The `cargo-bench` workflow was failing due to the nightly there being
too old. Conversely, we were using nightlies that were too new in some
tests, which may allow some 1.88.0+ code without declaring a minimum
rust requirement.

This commit converges them on one of the latest nightlies before 1.88.0.
@anoadragon453 anoadragon453 merged commit 1639c30 into develop Jun 30, 2026
44 of 46 checks passed
@anoadragon453 anoadragon453 deleted the anoa/fix_rust_tests_ci branch June 30, 2026 11:46
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