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

DIG-1836: fix snyk vulnerabilities #904

Merged
merged 3 commits into from
Dec 11, 2024
Merged

DIG-1836: fix snyk vulnerabilities #904

merged 3 commits into from
Dec 11, 2024

Conversation

daisieh
Copy link
Member

@daisieh daisieh commented Dec 6, 2024

This passes snyk test on my local machine now.

I added some env vars to env.sh so that if you want to run the pytest for candigv2-authx, you can do so from that directory, as long as you're in the candig conda env:

(candig) MacBook-Pro:candigv2-authx$ source ../CanDIGv2/env.sh 
(candig) MacBook-Pro:candigv2-authx$ pytest

@daisieh daisieh requested a review from mshadbolt December 6, 2024 23:29
Copy link
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

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

I tried out fresh rebulid and everything worked well, all integration tests passed, although on the first run, some htsget tests failed. A secondary run had them all passing.

when I tried using the provided way to pytest in authx repo, I get an assertion error:

(candig) marionshadbolt@Marions-Air candigv2-authx % source ../CanDIGv2/env.sh
(candig) marionshadbolt@Marions-Air candigv2-authx % pytest
======================================= test session starts ========================================
platform darwin -- Python 3.12.8, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/marionshadbolt/Documents/GitHub/candigv2-authx
configfile: pyproject.toml
plugins: Faker-33.1.0, cov-2.7.1, anyio-4.7.0, requests-mock-1.12.1
collected 11 items                                                                                 

test_auth.py ..F........                                                                     [100%]

============================================= FAILURES =============================================
_________________________________________ test_user_email __________________________________________

    def test_user_email():
            """
            If OPA is present, check to see that the user's email is returned.
            """
            if OPA_URL is not None:
>               assert authx.auth.get_user_email(FakeRequest(site_admin=True), opa_url=OPA_URL, admin_secret=OPA_SECRET) == f"{SITE_ADMIN_USER}@test.ca"
E               AssertionError: assert '[email protected]' == '[email protected]@test.ca'
E                 
E                 - [email protected]@test.ca
E                 ?                   --------
E                 + [email protected]

test_auth.py:100: AssertionError
========================================= warnings summary =========================================
test_auth.py::test_put_aws_credential
  /Users/marionshadbolt/Documents/GitHub/candigv2-authx/test_auth.py:165: UserWarning: aws credential tests can only be run within the candig-ingest container
    warnings.warn(UserWarning("aws credential tests can only be run within the candig-ingest container"))

test_auth.py::test_get_s3_url
  /Users/marionshadbolt/Documents/GitHub/candigv2-authx/test_auth.py:208: UserWarning: MINIO_URL is not set
    warnings.warn(UserWarning("MINIO_URL is not set"))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================== short test summary info ======================================
FAILED test_auth.py::test_user_email - AssertionError: assert '[email protected]' == '[email protected]@test.ca'

@daisieh
Copy link
Member Author

daisieh commented Dec 7, 2024

Did you re-run pip install?

pip install -r etc/venv/requirements.txt

Copy link
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

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

worked after updating my local authx

@daisieh daisieh merged commit b8301a6 into develop Dec 11, 2024
1 check passed
@daisieh daisieh deleted the daisieh/updates branch December 11, 2024 17:43
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.

2 participants