-
Notifications
You must be signed in to change notification settings - Fork 687
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
Using pure python code to download and verify gpg encrypted files/messages #3692
Using pure python code to download and verify gpg encrypted files/messages #3692
Conversation
Removing old method calls from user creation logic, this is only used inside of the container for the functional testing.
The test requirements now have requests[socks] as dependency. Using the same we are now directly downloading the files/messages from the .onion address for functional tests. The old external command file also got removed this committ. We are creating the gpg object for both container based local testing and external testing (in functional tests). Fixes: freedomofpress#3691 freedomofpress#3687
Tested as follows:
All functional tests pass locally again, LGTM. This will fail against staging until the app-test role is fixed, so I didn't do the instance_information.json version of the test. But if this is merged into tbb-0.9.0 then PR #3697 will get staging working too. |
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.
diff looks good (one nit inline), just needs testing on external server to verify proxies
logic works in return_downloaded_content
@@ -640,14 +641,13 @@ def _journalist_downloads_message(self): | |||
|
|||
# Downloading files with Selenium is tricky because it cannot automate | |||
# the browser's file download dialog. We can directly request the file | |||
# using urllib2, but we need to pass the cookies for the logged in user | |||
# using requests, but we need to pass the cookies for the logged in user | |||
# for Flask to allow this. | |||
def cookie_string_from_selenium_cookies(cookies): |
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.
Nit: this function name is now misleading so we should update it since now it's returning a dict for requests
@@ -279,7 +268,7 @@ def setup(self, session_expiration=30): | |||
# This user is required for our tests cases to login | |||
self.admin_user = { | |||
"name": "journalist", | |||
"password": "WEjwn8ZyczDhQSK24YKM8C9a", | |||
"password": "correct horse battery staple profanity oil chewy", |
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.
thanks for updating this 👍
Having some trouble testing this against remote servers (#3697 is intended to fix). So far, looks like much of the struggle I've had relates to formatting problems on the Here's a brief report on state of functional tests passing
Regarding the formatting tweaks, here are a few rules I've sketched out based on my understanding of
It's also necessary to create a test user manually, via |
@conorsch can you please add "sleep_time": 30 in the instance_information.json and retry the tests? I wonder where they fail. |
Based on conversations with @kushaldas, the steps to test against an external server interactively (i.e. not using
I am using these steps to test now and will report back on this ticket. |
I also found that you can create the staging vm from the same branch itself, when it will fail in the tbb ansible things, just ssh into vagrant app-staging and restart the apache2 process. |
Well, to reduce the number of variables while testing, if someone is testing this interactively, let's have them follow these steps for clarity. |
The same tests which I had failing before, are now passing while the only thing I changed is that I am on 100Mbps connection. |
Here is an example
|
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.
Despite the tests timeout and a few failures .... i vote we keep this moving into the feature branch.. we have way too many lingering PRs that need to go in here that its becoming a bottleneck to review. Obv. before merge into develop everything has to pass but lets work out of one concise branch for that resolution
@msheiny I'm with you on that, especially since driving forward here will unblock the upcoming CI work, which will give us a heck of a lot more clarity on test behavior, as well as minimize review time by running the tests in CI, rather than on developer workstations. Let's keep moving! |
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.
Approving for merge into the tbb-0.9.0
feature branch. There's more work to do, and plenty of outstanding PRs. Looking forward to hammering CI into respectable shape on the feature branch to increase confidence in the new test logic.
Status
Ready for review
Description of Changes
Fixes #3691 #3687.
Changes proposed in this pull request:
Testing
To test against the local container, and then create an instance_information.json file for an external staging server, and then against the same.
Deployment
Any special considerations for deployment? Consider both:
Checklist
If you made changes to the server application code:
make ci-lint
) and tests (make -C securedrop test
) pass in the development containerIf you made changes to
securedrop-admin
:make -C admin test
) pass in the admin development containerIf you made changes to the system configuration:
If you made non-trivial code changes:
If you made changes to documentation:
make docs-lint
) passed locally