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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added functionality to load test data during staging provisioning #5143

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

zenmonkeykstop
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop commented Feb 24, 2020

Status

Ready for review

Description of Changes

Fixes #5140 .

Adds option to provision a staging environment using instance data from a backup file.

Testing

Using an existing SecureDrop backup tarball (say, sd-backup.tar.gz):

  • checkout this branch
  • create a directory install_files/ansible-base/test-data and copy the backup file there.
  • run make build-debs && make staging, verify that it completes successfully
  • create an admin account, log into the JI, and verify that there are no sources or other journalist accounts on the instance
  • run TEST_DATA_FILE="sd-backup.tar.gz" make staging and verify that it completes successfully
  • verify that the SI and JI addresses remain unchanged from the initial run, and have not been set to those in the backup tarball
  • create an admin account, log into the JI, and verify that the sources and journalist accounts on the instance match those from the backup tarball
  • verify that source login and submission, and journalist reply processes work correctly.

Deployment

Development/QA-only change

Checklist

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

@zenmonkeykstop zenmonkeykstop force-pushed the apply-dataset-to-staging branch 2 times, most recently from c663ec9 to 0c09f85 Compare February 25, 2020 00:17
@zenmonkeykstop zenmonkeykstop force-pushed the apply-dataset-to-staging branch from 0c09f85 to bb97849 Compare February 25, 2020 01:20
@zenmonkeykstop zenmonkeykstop changed the title added optional extra variable to load test data in staging added functionality to load test data during staging provisioning Feb 25, 2020
@zenmonkeykstop zenmonkeykstop marked this pull request as ready for review February 25, 2020 18:36
Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

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

Thanks @zenmonkeykstop tested as follows using your test plan:

  • checkout this branch
  • create a directory install_files/ansible-base/test-data and copy the backup file there.
  • run make build-debs && make staging, verify that it completes successfully
  • create an admin account, log into the JI, and verify that there are no sources or other journalist accounts on the instance
  • run TEST_DATA_FILE="sd-backup.tar.gz" make staging and verify that it completes successfully
  • verify that the SI and JI addresses remain unchanged from the initial run, and have not been set to those in the backup tarball
  • create an admin account, log into the JI, and verify that the sources and journalist accounts on the instance match those from the backup tarball
  • verify that source login and submission, and journalist reply processes work correctly.
    Additional tests
  • backup is properly gitignored

I ran into #4364 but it seems unrelated these changes.

I think prior to merge, it might be worth capturing the instructions from the test plan into some developer-facing docs? What do you think?

@zenmonkeykstop
Copy link
Contributor Author

No problem! added in a description (and admonishment not to use data from a live instance for testing) in the development docs.

Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

Looks great. Full test plan passes locally. @emkll already asked for, and received, docs, so adding a +1 for merge.

CI failed on the updater gui tests, which is unrelated, so restarted the job.

Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

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

CI is now passing, merging!

@emkll emkll merged commit 72c4b11 into freedomofpress:develop Feb 27, 2020
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.

Add functionality to load test dataset during staging setup
3 participants