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

Use temp .netrc file for integration tests and support NETRC environment variable #808

Merged
merged 21 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-pkg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ runs:

- name: Install package and test dependencies
shell: bash
run: pip install .[test]
run: pip install --root-user-action ignore ".[test]"
9 changes: 6 additions & 3 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ jobs:

steps:
- name: Fetch user permission
if: github.event_name == 'pull_request_target'
id: permission
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}

- name: Check user permission
if: ${{ steps.permission.outputs.require-result == 'false' }}
# The name of the output require-result is a bit confusing, but when its value
# is 'false', it means that the triggering actor does NOT have the required
# permission.
if: github.event_name == 'pull_request_target' && steps.permission.outputs.require-result == 'false'

# If the triggering actor does not have write permission (i.e., this is a
# PR from a fork), then we exit, otherwise most of the integration tests will
# fail because they require access to secrets. In this case, a maintainer
Expand All @@ -78,8 +83,6 @@ jobs:
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EDL_PASSWORD }}
EARTHACCESS_TEST_USERNAME: ${{ secrets.EDL_USERNAME }}
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember why this was here, a meta test about environment variables being present I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I searched through the code and found where this appeared, and the logic did not appear to be doing anything in this regard, so I eliminated its code use as well. I suspect this was perhaps originally a way to configure 2 sets of creds locally, where 1 set was someone's "real" creds (the vars without TEST in the names), and a second set for "test" creds, so that when running integration tests locally, you could avoid using your "real" creds. However, I don't see any real value in that.

EARTHACCESS_TEST_PASSWORD: ${{ secrets.EDL_PASSWORD }}
run: ./scripts/integration-test.sh

- name: Upload coverage report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mindeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
python-version: 3.9

- name: Install minimum-compatible dependencies
run: uv sync --resolution lowest-direct --extra test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ htmlcov
dist
site
.coverage
.coverage.*
coverage.xml
.netlify
test.db
Expand Down
Loading
Loading