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

optimise test github action #920

Merged
merged 7 commits into from
May 23, 2022
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
15 changes: 5 additions & 10 deletions .github/workflows/test_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,22 @@ on:
branches: [ develop, stable, nbtests ]
pull_request:
branches: [ develop, stable ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Pre-pull images
run: docker-compose pull

- name: Activate Docker cache
uses: satackey/action-docker-layer-caching@v0.0.8
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Set up containers
run: |
docker-compose up -d

- name: Set up Datacube
run: |
cat Tests/setup_test_datacube.sh | docker-compose exec -T index bash
docker-compose exec -T sandbox datacube product list
docker-compose exec -T index setup_test_datacube.sh
docker-compose exec -T index datacube product list

- name: Test with pytest
run: |
docker-compose exec -T sandbox pip install testbook
Expand Down
376 changes: 188 additions & 188 deletions Beginners_guide/04_Loading_data.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Tests/Beginners_guide/01_Jupyter_notebooks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
NB_PATH = NB_DIR / "Beginners_guide" / "01_Jupyter_notebooks.ipynb"


@testbook(NB_PATH, execute=True)
@testbook(NB_PATH, execute=True, timeout=180)
def test_ok(tb):
assert True # ok
2 changes: 1 addition & 1 deletion Tests/Beginners_guide/02_DEA_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
NB_PATH = NB_DIR / "Beginners_guide" / "02_DEA.ipynb"


@testbook(NB_PATH, execute=True)
@testbook(NB_PATH, execute=True, timeout=180)
def test_ok(tb):
assert True # ok
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
NB_PATH = NB_DIR / "Beginners_guide" / "03_Products_and_measurements.ipynb"


@testbook(NB_PATH, execute=True)
@testbook(NB_PATH, execute=True, timeout=180)
def test_ok(tb):
assert True # ok
2 changes: 1 addition & 1 deletion Tests/Beginners_guide/04_Loading_data_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
NB_PATH = NB_DIR / "Beginners_guide" / "04_Loading_data.ipynb"


@testbook(NB_PATH, execute=True)
@testbook(NB_PATH, execute=True, timeout=180)
def test_ok(tb):
assert True # ok
2 changes: 1 addition & 1 deletion Tests/Beginners_guide/06_Basic_analysis_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture(scope="module")
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Beginners_guide/07_Intro_to_numpy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def tb():
# Update working directory to ensure relative links in notebooks work
os.chdir(NB_DIR.parent)

with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Animated_timeseries_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def tb():
# Update working directory to ensure relative links in notebooks work
os.chdir(NB_DIR.parent)

with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.fixture(scope="module")
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Contour_extraction_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def tb():
# Update working directory to ensure relative links in notebooks work
os.chdir(NB_DIR.parent)

with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Exporting_GeoTIFFs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture(scope="module")
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Generating_composites_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def tb():
# Update working directory to ensure relative links in notebooks work
os.chdir(NB_DIR.parent)

with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Polygon_drill_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture(scope="module")
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Rasterize_vectorize_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture(scope="module")
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Tidal_modelling_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture(scope="module")
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
2 changes: 1 addition & 1 deletion Tests/Frequently_used_code/Using_load_ard_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture(scope='module')
def tb():
with testbook(NB_PATH, execute=True) as tb:
with testbook(NB_PATH, execute=True, timeout=180) as tb:
yield tb


Expand Down
115 changes: 60 additions & 55 deletions Tests/setup_test_datacube.sh
100644 → 100755

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ services:
- DB_DATABASE=postgres
- DB_PORT=5432
- AWS_DEFAULT_REGION=ap-southeast-2
- METADATA_CATALOG=https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/a4f39b485b33608a016032d9987251881fec4b6f/workspaces/sandbox-metadata.yaml
- PRODUCT_CATALOG=https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/87ca056fa62900596cbf05612da9033fc763009c/workspaces/sandbox-products.csv
volumes:
- ./Tests/setup_test_datacube.sh:/usr/local/bin/setup_test_datacube.sh
depends_on:
- postgres
entrypoint: bash -c 'sleep infinity'