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

Fix test_auth_environ_raises integration test #320

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

jrbourbeau
Copy link
Collaborator

This is currently failing on main with FAILED tests/integration/test_api.py::test_auth_environ_raises - Failed: DID NOT RAISE <class 'RuntimeError'> (for example, see this CI build) due to the new automatic authentication update (xref #300).

This PR update this test accordingly so it passes while still keeping the original intent of the test

@github-actions
Copy link

github-actions bot commented Oct 17, 2023

Binder 👈 Launch a binder notebook on this branch for commit 709c10d

I will automatically update this comment whenever this PR is modified

Binder 👈 Launch a binder notebook on this branch for commit 5517c56

Binder 👈 Launch a binder notebook on this branch for commit 234f9af

MattF-NSIDC
MattF-NSIDC previously approved these changes Oct 17, 2023
Copy link

@MattF-NSIDC MattF-NSIDC left a comment

Choose a reason for hiding this comment

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

LGTM, but I felt the comment could use a touch more detail :)

Any idea why this didn't fail on the feature branch prior to merge?

tests/integration/test_api.py Outdated Show resolved Hide resolved
Co-authored-by: Matt Fisher <[email protected]>
@jrbourbeau
Copy link
Collaborator Author

Any idea why this didn't fail on the feature branch prior to merge?

Integration tests aren't run on PRs, only pushes to main

on:
push:
branches:
- main
paths:
- earthaccess/**
- tests/**
- docs/**
- binder/**

@MattF-NSIDC
Copy link

MattF-NSIDC commented Oct 17, 2023

OT: Any opinions on setting up integration tests to also run on workflow_dispatch or in response to a comment in a PR? Would be good for certain changes to be able to manually trigger the integration tests on a feature branch. (cc @betolink)

@jrbourbeau
Copy link
Collaborator Author

The main issue is the integration tests are using repo secrets, which aren't available on forks, only the base nsidc/earthaccess repo. I'm sure we could find some way around this, but I'm skeptical it will be worth the effort (could be wrong about that though).

I think increased visibility into when integration tests fail would help. Over in dask we have a similar CI build that run on pushes to main + a nightly cron and we use this logic to open an issue when there's a failure. That way we at least get a ping when there's a failure. Maybe something similar here would be useful.

@jrbourbeau jrbourbeau merged commit 6fbc4ae into nsidc:main Oct 17, 2023
7 checks passed
@MattF-NSIDC
Copy link

Great points! To be clear, the event type which protects secrets from forks is pull_request. If we trigger on a PR comment, the event type would be issue_comment, and we should be very careful that our workflow checks the commenter is a repository member before running the workflow. The triggering user would also have to be aware of the importance of reviewing the PR for malicious code before triggering the workflow. That last part makes this far from an ideal choice :)

@jrbourbeau jrbourbeau deleted the test_auth_environ_raises-fixup branch October 17, 2023 20:22
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