Skip to content

Commit

Permalink
Issue #4 initial GitHub workflow to run unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Jun 19, 2024
1 parent 921e1e4 commit 68e04d8
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Unit tests"

on: [push]

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package with test dependencies
run: |
python -m pip install qa/tools
python -m pip install -r qa/unittests/requirements.txt
- name: Test with pytest
run: |
cd qa/unittests
pytest
6 changes: 3 additions & 3 deletions qa/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Install the test dependencies, including the reusable tools from `apex-algorithm
e.g. when working from the `qa/benchmarks` folder:

```bash
# Install general test requirements
pip install -r requirements.txt
# Install apex-algorithm-qa-tools
pip install ../tools
# Install general test requirements
pip install -r requirements.txt
```

When intending to do development on `apex-algorithm-qa-tools`,
Expand All @@ -29,6 +29,6 @@ make sure to include the `-e` flag to install in editable mode.

From `qa/benchmarks` folder, run:

```
```bash
pytest
```
1 change: 1 addition & 0 deletions qa/benchmarks/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
apex-algorithm-qa-tools
openeo>=0.30.0
pytest>=8.2.0
28 changes: 28 additions & 0 deletions qa/unittests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,31 @@

This is pytest-based unittest suite to verify the validity of resources
hosted in this repository.


## Set up

Make sure to work in a virtual environment
(e.g. with `python -m venv venv`),
to ensure isolation from other projects.

Install the test dependencies, including the reusable tools from `apex-algorithm-qa-tools`,
e.g. when working from the `qa/unittests` folder:

```bash
# Install apex-algorithm-qa-tools
pip install ../tools
# Install general test requirements
pip install -r requirements.txt
```

When intending to do development on `apex-algorithm-qa-tools`,
make sure to include the `-e` flag to install in editable mode.

## Run benchmarks

From `qa/unittests` folder, run:

```bash
pytest
```
2 changes: 2 additions & 0 deletions qa/unittests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apex-algorithm-qa-tools
pytest>=8.2.0
File renamed without changes.

0 comments on commit 68e04d8

Please sign in to comment.