+
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

correctness of tests.

The ids that get offsets are: contact ids chat ids message ids webxdc
status update ids
@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
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

1 participant

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载