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

Implement script to setup workspace for tests #133

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GG-Yanne
Copy link
Contributor

@GG-Yanne GG-Yanne commented Jan 9, 2025

What does this PR do ?

This PR introduces a script that will attempt to setup the workspace used for running tests without relying on cassettes reliably. It also loosens some constraint on the test to make the workspace slightly easier to setup.

Limitations

There are a few limitations imposed by the API that prevents the workspace from being completely setup, a notice has been added at the top of the script, those limitations are :

  • We cannot create members, so there must exist a minimum amount of members in the workspace
    • This also means deleted members cannot be brought back from the script
  • We cannot integrate a source entirely from the public API
    • There must exist a source in the workspace

How to run it

The script relies on the following environment variables:

  • GITGUARDIAN_API_KEY : The PAT or SAT used to authenticate to GitGuardian's API
  • GITGUARDIAN_API_URL : [Optional] Base uri for GitGuardian's API

In order to run the script you may simply run :

pdm run scripts/setup_test_workspace.py

Alternatively, the script runs whenever the release script is used to run the tests :

pdm run scripts/release run-tests

@GG-Yanne GG-Yanne self-assigned this Jan 9, 2025
@GG-Yanne GG-Yanne requested a review from a team as a code owner January 9, 2025 12:42
@GG-Yanne GG-Yanne added the skip-changelog No changelog check in the CI label Jan 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.99%. Comparing base (036ad2d) to head (c7b5714).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #133   +/-   ##
=======================================
  Coverage   93.99%   93.99%           
=======================================
  Files           7        7           
  Lines        1382     1382           
=======================================
  Hits         1299     1299           
  Misses         83       83           
Flag Coverage Δ
unittests 93.99% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GG-Yanne GG-Yanne force-pushed the ybensafia/setup-test-workplace-script branch from 874e738 to c7b5714 Compare January 9, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog check in the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants