Skip to content

SG-35018 Condition auth for Jenkins environment #350

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

Merged
merged 20 commits into from
Jun 27, 2024

Conversation

carlos-villavicencio-adsk
Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk commented Jun 20, 2024

Checklist

  • Use login/password for authentication when running on SG_JENKINS.
  • Unskip and fix old tests
  • Skip datetime tests on Jenkins (they also fail locally)
  • Refactor helper method to reduce sleep time in e861767

Centralized authentication

Now all tests use the same authentication credentials. By default, it uses and expects a script name/key pair provided on the config file. However, a special flag SG_JENKINS is considered to use username/password only for SG sites that haven't created a script.

Improved test time

Before After
image image

Test durations

Argument durations was added to pytest to detect the slowest tests and improve them in the future

image

How to reproduce Jenkins environment locally:

Step 1: remove script_name/api_key from config file

Step 2: add human_login / human_password to config file

Step 3: run

export SG_JENKINS=1
pytest tests/test_api.py

@carlos-villavicencio-adsk carlos-villavicencio-adsk marked this pull request as draft June 21, 2024 19:43
julien-lang
julien-lang previously approved these changes Jun 26, 2024
Copy link
Contributor

@julien-lang julien-lang left a comment

Choose a reason for hiding this comment

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

Looks good. Only a few minor comments.

@carlos-villavicencio-adsk carlos-villavicencio-adsk merged commit bd5245d into master Jun 27, 2024
24 checks passed
@carlos-villavicencio-adsk carlos-villavicencio-adsk deleted the ticket/SG-35018_jenkins branch June 27, 2024 19:10
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.

3 participants