Skip to content

Commit

Permalink
review tests
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Dec 6, 2024
1 parent 181303b commit a6e6b6f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,51 @@ name: Upload Python Package
on:
push: {}
release:
types: [created]
types: [ created ]

jobs:
quality:
name: Code QA
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: pip install black flake8 isort
- run: black --version
- run: isort --version
- run: flake8 --version
- run: isort --check .
- run: black --check .
- run: flake8 .
- uses: actions/checkout@v2
- run: pip install black flake8 isort
- run: black --version
- run: isort --version
- run: flake8 --version
- run: isort --check .
- run: black --check .
- run: flake8 .

checks:
if: ${{ github.event_name == 'release' }}

strategy:
fail-fast: false
matrix:
platform: ["ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11" ]
platform: [ "ubuntu-latest", "macos-latest" ]
python-version: [ "3.9", "3.10", "3.11" ]

name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
needs: quality

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: |
pip install pytest
pip install -e .
pip install -r tests/requirements.txt
pip freeze
- name: Install
run: |
pip install pytest
pip install -e .
pip install -r tests/requirements.txt
pip freeze
- name: Tests
run: pytest
- name: Tests
run: env SOURCES_TO_TEST=ecmwf pytest

deploy:

Expand All @@ -68,11 +68,11 @@ jobs:

- name: Check that tag version matches code version
run: |
tag=${GITHUB_REF#refs/tags/}
version=$(python setup.py --version)
echo 'tag='$tag
echo "version file="$version
test "$tag" == "$version"
tag=${GITHUB_REF#refs/tags/}
version=$(python setup.py --version)
echo 'tag='$tag
echo "version file="$version
test "$tag" == "$version"
- name: Install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion tests/test_sources.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import pytest
import os

from ecmwf.opendata import Client
from ecmwf.opendata.bufr import count_bufrs
from ecmwf.opendata.grib import count_gribs

SOURCES = ["ecmwf", "azure", "aws"]
SOURCES = os.getenv("SOURCES_TO_TEST", "ecmwf,azure,aws").split(",")


@pytest.mark.parametrize("source", SOURCES)
Expand Down

0 comments on commit a6e6b6f

Please sign in to comment.