Skip to content

Resolves Issue #1827, Adding generate and reset_keys test scripts#1828

Open
afoote-mitre wants to merge 4 commits into
devfrom
af-1827
Open

Resolves Issue #1827, Adding generate and reset_keys test scripts#1828
afoote-mitre wants to merge 4 commits into
devfrom
af-1827

Conversation

@afoote-mitre
Copy link
Copy Markdown
Collaborator

Closes Issue #1827

Summary

The test code to reset keys and generate a database with realistic looking users, was originally located in the DR Client repository. This code has been migrated over to services where it actually belongs.

generate requires that the following .env vars are set

  • VITE_CVE_SERVICES_URL
  • VITE_TEST_API_USER
  • VITE_TEST_API_ORG
  • VITE_TEST_API_KEY

reset_keys requires that the following .env vars are set

  • TEST_DATA_USER_SECRET_HASH

Important Changes

scripts/test_data/generate.js

  • Contains the logic to generate realistic users
    scripts/test_data/reset_keys.js
  • Contains the logic to test resetting keys
    scripts/test_data/testData.js
  • Contains the data for the realistic users added by the generate script

Testing

Steps to manually test updated functionality, if possible

  • 1) npm run populate:dev
  • 2) npm run migrate:dev
  • 3) npm run generate which should succeed in adding 20 test orgs
  • 4) Find the secret key from any of the users added by generate, set it to the TEST_DATA_USER_SECRET_HASH in your .env
  • 5) npm run reset_keys which should succeed in updating keys of all test users found

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.

1 participant