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

2346 - data files load tests #3388

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

2346 - data files load tests #3388

wants to merge 16 commits into from

Conversation

jtimpe
Copy link

@jtimpe jtimpe commented Dec 19, 2024

Summary of Changes

Pull request closes #2346

How to Test

brew install k6
cd tdrs-backend && docker compose up
cd tdrs-frontend && docker compose up --build
docker compose exec web python manage.py generate_cypress_users
  • Run the tests: task k6 SCRIPT=tests/data-files.js
    • Execute one scenario at a time: task k6 SCENARIO={api|browser} SCRIPT=tests/data-files.js
    • Change the loadProfile by updating the scenarios object in performance-tests/tests/data-files.js - NOTE: if there's interest, we can have the task k6 command take a LOAD_PROFILE arg similar to SCENARIO

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • Write tests that simulate a file upload resulting in parsing
  • Testing toolset should remotely target deployed Staging environment
  • lfrohlich and/or adpennington confirmed that ACs are met.

Deliverable 2: Tested Code

  • Are all areas of code introduced in this PR meaningfully tested?
    • If this PR introduces backend code changes, are they meaningfully tested?
    • If this PR introduces frontend code changes, are they meaningfully tested?
  • Are code coverage minimums met?
    • Frontend coverage: [insert coverage %] (see CodeCov Report comment in PR)
    • Backend coverage: [insert coverage %] (see CodeCov Report comment in PR)

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI?
  • Are frontend code style checks passing on CircleCI?
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

  • Does this PR complete the epic?
  • Are links included to any other gov-approved PRs associated with epic?
  • Does PR include documentation for Raft's a11y review?
  • Did automated and manual testing with iamjolly and ttran-hub using Accessibility Insights reveal any errors introduced in this PR?

Deliverable 5: Deployed

  • Was the code successfully deployed via automated CircleCI process to development on Cloud.gov?

Deliverable 6: Documented

  • Does this PR provide background for why coding decisions were made?
  • If this PR introduces backend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces frontend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces dependencies, are their licenses documented?
  • Can reviewer explain and take ownership of these elements presented in this code review?

Deliverable 7: Secure

  • Does the OWASP Scan pass on CircleCI?
  • Do manual code review and manual testing detect any new security issues?
  • If new issues detected, is investigation and/or remediation plan documented?

Deliverable 8: User Research

Research product(s) clearly articulate(s):

  • the purpose of the research
  • methods used to conduct the research
  • who participated in the research
  • what was tested and how
  • impact of research on TDP
  • (if applicable) final design mockups produced for TDP development

@jtimpe jtimpe self-assigned this Dec 19, 2024
@@ -558,3 +558,6 @@ class Common(Configuration):
BULK_CREATE_BATCH_SIZE = os.getenv("BULK_CREATE_BATCH_SIZE", 10000)
MEDIAN_LINE_PARSE_TIME = os.getenv("MEDIAN_LINE_PARSE_TIME", 0.0005574226379394531)
BYPASS_OFA_AUTH = os.getenv("BYPASS_OFA_AUTH", False)

CELERY_WORKER_SEND_TASK_EVENTS = True
CELERY_TASK_SEND_SENT_EVENT = True
Copy link
Author

Choose a reason for hiding this comment

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

should i leave these on?

Copy link

Choose a reason for hiding this comment

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

You could move them to the local.py settings since they will only work there for the time being.

@jtimpe jtimpe changed the title 2346 - load tests 2346 - data files load tests Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.48%. Comparing base (ff01121) to head (cc6ae6d).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3388   +/-   ##
========================================
  Coverage    91.48%   91.48%           
========================================
  Files          299      299           
  Lines         8595     8595           
  Branches       636      636           
========================================
  Hits          7863     7863           
  Misses         615      615           
  Partials       117      117           
Flag Coverage Δ
dev-backend 91.32% <ø> (ø)
dev-frontend 92.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d308af6...cc6ae6d. Read the comment docs.

const body = {
file: http.file(file, 'loadtest-file.txt'),
original_filename: 'ADS.E2J.FTP2.TS06',
user: 'f94b3a2e-4ee5-4d4b-bab3-20147cb6f480',
Copy link

Choose a reason for hiding this comment

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

The api tests are failing because the user with this ID does not exist. Could we update the generate cypress user to force this ID? Or, can we make another call to get the ID?
Screenshot 2024-12-20 at 11 09 25 AM

Copy link
Author

Choose a reason for hiding this comment

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

good catch! i updated it so it pulls the user id from the login/cypress endpoint. caveat is that it would only work when logged in as the admin user (unless we update the endpoint)

Copy link

@elipe17 elipe17 left a comment

Choose a reason for hiding this comment

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

Looking good, nice work!

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.

As tech lead, I want to load test our application
3 participants