Skip to content

Conversation

Simon-Laux
Copy link
Contributor

@Simon-Laux Simon-Laux commented Oct 11, 2025

and fix the mistakes in tests that get discovered by this.

  • add tests for setting the offset
  • fix the tests that were discovered by this
  • find a solution for the golden test problem (golden tests expect the offset to be deterministic, currently it is derived from the account id which is random)

closes #6799

@Simon-Laux
Copy link
Contributor Author

Seems my approach of just dividing the random number does not work, this approach is not compatible with the golden tests:

    thread 'tests::verified_chats::test_verified_chat_editor_reordering' panicked at src/test_utils.rs:977:13:
    assertion failed: `(left == right)`: To update the expected value, run `UPDATE_GOLDEN_TESTS=1 cargo test`

    Diff < left / right > :
    <Group#Chat#1979039380: Group [3 member(s)] 🛡️
    >Group#Chat#11: Group [3 member(s)] 🛡️

we could add an id to the named accounts, as this offset needs to be unique account per per test, but not unique across all tests.

@Simon-Laux Simon-Laux self-assigned this Oct 11, 2025
@Simon-Laux Simon-Laux changed the title test: Add unique offsets to ids generated by TestContext to increase test: Add unique offsets to ids generated by TestContext to increase test correctness Oct 11, 2025
@Hocuri
Copy link
Collaborator

Hocuri commented Oct 13, 2025

UPDATE_GOLDEN_TESTS=1 cargo nextest run

@Simon-Laux Simon-Laux force-pushed the simon/i6799-add-offset-to-testaccount-ids-to-make-tests-more-reliable branch from b85ffa1 to 6aa4739 Compare October 16, 2025 20:23
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.

Offset row IDs in test accounts

2 participants