Skip to content

Commit

Permalink
Test out uv lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Jan 20, 2025
1 parent 1528d2e commit fc33e82
Show file tree
Hide file tree
Showing 12 changed files with 4,405 additions and 60 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -139,10 +139,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ert
run: |
uv pip install ".[dev, everest]"
uv sync --extra everest --group dev
- name: Make test directory
run: |
Expand All @@ -153,7 +156,7 @@ jobs:
- name: Test docs
run: |
sphinx-build -n -v -E -W ./docs/ert ./tmp/ert_docs
uv run sphinx-build -n -v -E -W ./docs/ert ./tmp/ert_docs
publish:
name: Publish to PyPI
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -25,12 +25,15 @@ jobs:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: '3.12'
- run: |
uv pip install ".[dev, everest]"
uv sync --extra everest --group dev
uv pip uninstall pytest-benchmark
uv pip install pytest-codspeed
- uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: |
pytest tests/ert/performance_tests --codspeed --timeout=1200
uv run pytest tests/ert/performance_tests --codspeed --timeout=1200
13 changes: 8 additions & 5 deletions .github/workflows/run_ert_test_data_setups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

env:
ERT_SHOW_BACKTRACE: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
run-ert-test-data:
Expand Down Expand Up @@ -45,26 +45,29 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ERT and dependencies
run: |
uv pip install .
uv sync
- name: Test poly example
run: |
pushd test-data/ert/poly_example
ert test_run poly.ert
uv run ert test_run poly.ert
popd
- name: Test snake_oil
run: |
pushd test-data/ert/snake_oil
uv pip install oil_reservoir_synthesizer resdata
ert test_run snake_oil.ert
uv run ert test_run snake_oil.ert
popd
- name: Test snake_oil_field
run: |
pushd test-data/ert/snake_oil_field
ert test_run snake_oil.ert
uv run ert test_run snake_oil.ert
popd
9 changes: 6 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -35,12 +35,15 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ERT with style dependencies
run: |
uv pip install ".[style]"
uv sync --group style
- name: Run style check
if: ${{ always() }}
run: |
SKIP=no-commit-to-branch pre-commit run --all-files --show-diff-on-failure
SKIP=no-commit-to-branch uv run pre-commit run --all-files --show-diff-on-failure
20 changes: 12 additions & 8 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
tests-ert:
Expand All @@ -32,15 +32,18 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install ert
run: |
uv pip install ".[dev, everest]"
uv sync --extra everest --group dev
- name: GUI Test
if: inputs.test-type == 'gui-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25
- name: Upload artifact images
uses: actions/upload-artifact@v4
Expand All @@ -53,18 +56,18 @@ jobs:
- name: CLI Test
if: inputs.test-type == 'cli-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
- name: Unit Test
if: inputs.test-type == 'unit-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
pytest --doctest-modules --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
uv run pytest --doctest-modules --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
- name: Performance Test
if: inputs.test-type == 'performance-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25
- name: Upload coverage to Codecov
id: codecov1
Expand Down Expand Up @@ -102,11 +105,12 @@ jobs:

- name: Test CLI
run: |
ert --help
uv run ert --help
- name: Test for a clean repository
run: |
# Remove things we have generated on purpose:
ls -la
rm -rf .coverage
rm -f coverage.xml cov1.xml cov2.xml junit.xml
rm -f ert.*.whl
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/test_ert_with_flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
test-ert-with-flow:
Expand All @@ -25,10 +25,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install ert and everest
run: |
uv pip install ".[everest,dev]"
uv sync --extra everest --group dev
uv pip install git+https://github.com/equinor/everest-models
- name: Install flow
Expand All @@ -46,18 +49,18 @@ jobs:
- name: Run integration tests towards OPM flow without flowrun
run: |
set -e
pytest tests/ert/unit_tests/resources/test_run_flow_simulator.py
uv run pytest tests/ert/unit_tests/resources/test_run_flow_simulator.py
- name: Run Ert on an example configuration with flow
run: |
pushd test-data/ert/flow_example
perl -p -i -e 's/NUM_REALIZATIONS\s*12/NUM_REALIZATIONS 2/g' flow.ert
ert ensemble_experiment flow.ert
uv run ert ensemble_experiment flow.ert
popd
- name: Run Everest on an example configuration with flow
run: |
pushd test-data/everest/egg/everest/model
everest lint config_flow.yml
everest run config_flow.yml
uv run everest lint config_flow.yml
uv run everest run config_flow.yml
popd
13 changes: 8 additions & 5 deletions .github/workflows/test_ert_with_slurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
test-ert-on-slurm:
Expand All @@ -25,10 +25,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install ert
run: |
uv pip install ".[dev]"
uv sync --group dev
- name: Install and setup slurm
run: |
Expand Down Expand Up @@ -69,8 +72,8 @@ jobs:
run: |
set -e
export _ERT_TESTS_ALTERNATIVE_QUEUE=AlternativeQ
pytest tests/ert/unit_tests/scheduler --slurm
pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm
uv run pytest tests/ert/unit_tests/scheduler --slurm
uv run pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm
- name: Test poly-example on slurm
run: |
Expand All @@ -84,4 +87,4 @@ jobs:
QUEUE_SYSTEM SLURM
EOF
time ert ensemble_experiment poly.ert
time uv run ert ensemble_experiment poly.ert
19 changes: 11 additions & 8 deletions .github/workflows/test_everest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
NO_PROJECT_RES: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
tests-everest:
Expand All @@ -33,43 +33,46 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install Everest and dependencies
run: |
uv pip install ".[dev,everest]"
uv sync --extra everest --group dev
- name: Run Tests Linux
if: ${{ inputs.test-type == 'test' && runner.os != 'macOS'}}
run: |
pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test" --dist loadgroup -sv
uv run pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test" --dist loadgroup -sv
- name: Run Tests macOS
if: ${{ inputs.test-type == 'test' && runner.os == 'macOS'}}
run: |
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
uv run python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
- name: Run Integration Tests Linux
if: ${{inputs.test-type == 'integration-test' && runner.os != 'macOS'}}
run: |
pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test" --dist loadgroup -sv
uv run pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test" --dist loadgroup -sv
- name: Run Integration Tests macOS
if: ${{inputs.test-type == 'integration-test' && runner.os == 'macOS'}}
run: |
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
uv run python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
- name: Build Documentation
if: inputs.test-type == 'doc'
run: |
uv pip install git+https://github.com/equinor/everest-models.git
mkdir tmp
sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs
uv run sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs
- name: Run tests requiring everest-models
if: inputs.test-type == 'everest-models-test'
run: |
uv pip install git+https://github.com/equinor/everest-models.git
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m everest_models_test --dist loadgroup
uv run python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m everest_models_test --dist loadgroup
- name: Upload coverage to Codecov
if: inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc'
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test_semeio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Test Semeio
on: [pull_request]

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -36,10 +36,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ert
run: |
uv pip install .
uv sync
- name: Get semeio
run: |
Expand All @@ -48,5 +51,5 @@ jobs:
- name: Test semeio
run: |
pushd semeio
uv pip install ".[test]"
pytest
VIRTUAL_ENV=../.venv uv pip install ".[test]"
UV_PROJECT_ENVIRONMENT=../.venv uv run --no-sync pytest
Loading

0 comments on commit fc33e82

Please sign in to comment.