-
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
Tor functional test auto generation of instance_information.json #3705
Conversation
This is really for functional testing in staging environments, but the script doesnt hurt to be installed in prod. It doesn't elevate permissions or expose any sensitive details - you need to run as root in order to gain useful data.
This commit adds logic to the test runner so that a functional test json config gets dumped for usage in the tbb selenium test tools against staging.
Without this change, the upgrade scenario would utilize the app-test logic from the old repo. Which is not what we want. This is of course kind of "hacky". I welcome the opportunity to improve this with feedback :)
I'm not sure we are ready to shove this on prod instances AND I was running into weird old/new role logic under the molecule scenario. Ideally the fact should be in both roles but I dunno.. this seemed like an easier short-term fix.
This directory no longer exists with modern molecule versions and the ephemeral directory is now something like /tmp/molecule/${git_dir}/${scenario_dir}
ahhh shoot one sec... gotta retarget this |
(tl;dr: LGTM) Tested as follows on TBBGenTestConfig branch:
Logged into app-staging with
Logged out of app-staging, created instance_information.json and ran tests as follows:
Reviewed Repeated testing but using Vagrant staging environment instead ( It might be good to change the default 'sleep_time' value to something longer than 10sec - 30sec seems to be a more reasonable value, at least for me. Otherwise this looks good to go. |
So the changes in #3697 mean that the application tests are failing to run in the staging CI job:
We want (let me know if you disagree):
In addition, the testinfra staging test failures look to be legitimate due to the removal of testing related pip deps from the application server (not introduced in this PR). I think it makes sense to merge this and then address the unit tests in staging / testinfra fix in a followup PR. |
OK upon discussion, let's remove the application unit test run from staging since it's done in the |
Status
Ready for review
Description of Changes
Fixes #3621
I specifically only tested this against the
upgrade
scenario but really any staging scenario should work that includes theapp-test
role (where the logic resides).Changes proposed in this pull request:
app-test
role to pull back those details into a local file for functional testing in-takeTesting
How should the reviewer test this PR?
molecule converge -s upgrade
(you must be on a kvm box, and if you havent run this in a while... its going to take 30min+ depending on your connection the first run. It'll get stuck at the vagrant stage while pulling 3GB+ of boxes.)molecule side-effect -s upgrade
(will upgrade instances to whatever debs you have inbuild
plus build the instance_information.json locally)cd securedrop && ./bin/dev-shell ./bin/run-test --capture=no -v tests/functional
while that is going ^^ since we have a current failing test scenario the best way to confirm things are working quickly is to log into the app server:
molecule login -s upgrade -h app
and then tail the apache logs to make sure connections are happening
tail -f /var/log/apache2/journalist-access.log
(as root)Deployment
Any special considerations for deployment? Consider both:
Only affects CI and local dev-env.
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 non-trivial code changes: