Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing and incorrect assertions in Controller tests #1501

Merged

Conversation

gonzalo-bulnes
Copy link
Contributor

Description

When starting to encapsulate the export behavior, I realized that most tests covering the signal emissions were actually not testing anything 馃槵

This PR fixes that situation as a preliminary step to refactoring that code.
See the commit message for details 馃檪

鈿狅笍 Reviewers this PR is very small, but does require some back and forth between the tests and the code under test to confirm that I made the right judgement when fixing the tests that were inaccurate.

Test Plan

  • Verify the claims in the commit message
  • Pause of a moment and confirm that I made the right decisions when it comes to describing the desired behavior (that is, confirm that the tests now reflect the behavior we actually want to test in the Controller, and that I didn't get that wrong.)
  • Confirm that the current controller behavior hasn't changed (which means this fix doesn't require further testing once the test suite is green)

Checklist

If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:

  • I have updated the AppArmor profile
  • No update to the AppArmor profile is required for these changes
  • I don't know and would appreciate guidance

If these changes modify the database schema, you should include a database migration. Please check as applicable:

  • I have written a migration and upgraded a test database based on main and confirmed that the migration applies cleanly
  • I have written a migration but have not upgraded a test database based on main and would like the reviewer to do so
  • I need help writing a database migration
  • No database schema changes are needed

Comments

It's interesting to note that the test coverage does increase even if the test code isn't actually asserting anything. 馃檨

The assertions were missing when the behavior was initially added,
which explains why some of the signal name copy-pasting mistakes
were missed.

The timeout callback was removed in 45163e0.
See also #362
Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

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

nice fix

@sssoleileraaa sssoleileraaa merged commit 74b4489 into main Jun 3, 2022
SecureDrop Team Board automation moved this from Ready for Review to Done Jun 3, 2022
@sssoleileraaa sssoleileraaa deleted the fix-inaccurate-or-inactive-controller-export-tests branch June 3, 2022 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants