-
Notifications
You must be signed in to change notification settings - Fork 2
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
Test suite, CLI #74
Test suite, CLI #74
Changes from 32 commits
e3dfde3
4ef1861
8d895e3
3b8d17b
0892d15
b6462ed
4bbb2d6
19a66dd
bc866ff
b21d787
d647473
01ea5dc
03a7322
2c9f998
b01f076
7a59797
fb49304
572be4a
2c66eb8
5dfbd32
0601105
1eb2574
8152cda
784c69e
cc2f0ac
c9d1934
4fbd76f
406b569
0eaaf27
185acae
6272de1
8371980
9ca5e33
b307741
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.tar.gz filter=lfs diff=lfs merge=lfs -text |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Test steps | ||
on: | ||
pull_request: {} | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
python_run_scripts: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: ['3.9'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: install mpi | ||
run: sudo apt update && sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.version }} # install the python version needed | ||
cache: "pip" | ||
- name: install icesat2-tracks using pip | ||
run: pip install . | ||
- name: install pytest | ||
run: pip install pytest pytest-xdist | ||
- name: Run tests | ||
run: pytest --capture=sys --verbose --showlocals --tb=long --durations=5 --numprocesses=4 tests/test_steps.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For those new to the pytest framework, here is a breakdown of the command that runs the tests:
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workflow renamed. |
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feel free to use this hook in your local development environment. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# Count the number of 'def test_' in test_steps.py | ||
n=$(grep -c '^def test_' tests/test_steps.py) | ||
|
||
# if n > $(nproc) then n = $(nproc) | ||
if [ $n -gt $(nproc) ]; then | ||
n=$(nproc) | ||
fi | ||
|
||
# Run your Python script | ||
pytest -n $n tests/test_steps.py | ||
|
||
# Check the exit status of the Python script | ||
if [ $? -ne 0 ]; then | ||
echo "Tests failed, aborting push." | ||
exit 1 | ||
fi |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure as my linter is not reporting an issue for this file. I think I am using ruff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handles the tar.gz files with lfs.