-
Notifications
You must be signed in to change notification settings - Fork 686
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge qa_loader and create-dev-data; add seen data. #5645
Conversation
Couple of issues as per below: dev
staging
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make dev
shows all three sources as unseen now. i think it would be useful to go back to showing the default sources with more variation, e.g. the way it is on develop
:
- one source with all conversation items seen
- one source with all conversation items unseen
- one source with some conversation items seen (so the source will show up as unseen)
also, it looks like you show some sources without replies.
this is how it looks like on develop when you run NUM_SOURCES=10 make dev
:
did you intend to change this?
@creviera I got 2 unseen sources and one seen on my |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script populates test data as expected, with the exception of the Death Of Superman. One worthwhile change would be to reset the database before loading data, though this could also be addressed by documenting the existing manage.py action for this.
02ab886
to
bf61279
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ cassette generation for seen/unseen in the client is working again
✔️ a couple client functional tests (that are more brittle) are failing during cassette generation
- there is now 1 file attachment instead of 2 when running
make dev
which affects some functional tests, e.g.test_file_download
in the client - this is fine (not great but fine) since CI will not fail on the client repo. Client functional tests can be updated any time after this is merged to work with the new default config
❌ some SDK functional tests (that are more brittle) are failing during cassette generation
- now, not every source has a reply be default when running
make dev
which affects some tests, e.g.test_get_all_replies
andtest_get_replies_from_source
in the sdk - there will be CI failures since we have an SDK CI job that tests cassette generation. I think if we just add replies to each source by default again (the way it is on
main
) when runningmake dev
, the SDK functional tests will work again, but it would be best to make sure by following these steps to test cassette generation: https://github.com/freedomofpress/securedrop-sdk#generating-cassettes-for-api-calls-over-http. Another idea: If you don't want to add replies to every source by default, then you'll have to make a PR in the SDK repo with the functional test changes needed in order to work with this new default config. This will need to go out fairly quickly after this PR is merged and will take some time, so it should be done in parallel.
The deleted journalist is expected; sorry for not noting that in the test plan. There's a couple of axes of tension here: between dev and staging (the current We shouldn't fix the seed by default when running That same scenario is why I think we should try to have less predictability in the dev and test database by default. Tests that don't rely on cassettes should either establish the state they need (which could be done with fixtures -- #3836) or work with what they find, without brittle expectations. It's more work, but it's more robust, and it'll be important when we try to tackle #2535. I've also found variable data useful in interactive use; when changing the UI it can turn up things you didn't account for. To support fixture generation, I could modify Thoughts? |
That makes sense, John. What do you think about doing things in the following order (this PR should tackle the first step):
|
I've changed the I've changed |
8962eea
to
cad70db
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5645 +/- ##
============================================
+ Coverage 53.10% 81.14% +28.04%
============================================
Files 50 51 +1
Lines 5928 3872 -2056
Branches 530 482 -48
============================================
- Hits 3148 3142 -6
+ Misses 2678 631 -2047
+ Partials 102 99 -3
Continue to review full report at Codecov.
|
There was a lot of overlap between qa_loader.py and create-dev-data.py, so we're consolidating them.
A few tests in securedrop-sdk and securedrop-client make assumptions about the content of the test database, so until they can be fixed, make sure the default result of loaddata.py doesn't break them. Change loaddata.py to not fix the random seed by default, as this breaks additive usage, as in a staging environment for load testing, in a non-obvious way. Add the --seen-message-fraction and --seen-file-fraction to loaddata.py, giving more control over the number of submissions marked seen. Clarify loaddata.py output. Add the ability to pass loaddata.py options through dev-shell via the LOADDATA_ARGS environment variable. Remove the NUM_SOURCES and NUM_JOURNALISTS options from dev-shell.
Rebased and ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Status
Ready for review
Description of Changes
Fixes #5514.
There was a lot of overlap between
qa_loader.py
andcreate-dev-data.py
, so we're consolidating them while adding seen data to the populated database.Testing
make dev
and verify that the database is populated correctly.make build-debs && make staging
, log in to the app server, and run:sudo -u www-data bash
cd /var/www/securedrop
CRYPTOGRAPHY_ALLOW_OPENSSL_102=yes ./loaddata.py --source-count ALL
.The default three journalists and a number of sources should be created without any errors.
loaddata.py
a few more times, varying the number of journalists, sources, and files, messages and replies per source, to be created. Confirm the results are as expected.Deployment
This is dev/test only.
Checklist
If you made changes to the server application code:
make lint
) and tests (make test
) pass in the development containerIf you made non-trivial code changes:
Choose one of the following: