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

Test out uv lockfile #9561

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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
9 changes: 6 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
benchmark:
Expand All @@ -35,14 +35,17 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
python-version: "3.11"

- name: Install ert with dev-deps
run: |
uv pip install ".[dev]"
uv sync --group dev

- name: Run benchmark
run: |
pytest tests/ert/performance_tests/test_analysis.py::test_and_benchmark_adaptive_localization_with_fields --benchmark-json output.json
uv run pytest tests/ert/performance_tests/test_analysis.py::test_and_benchmark_adaptive_localization_with_fields --benchmark-json output.json

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
Expand Down
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 @@ -166,10 +166,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v4
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 @@ -180,7 +183,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@v4
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 @@ -44,26 +44,29 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v4
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 @@ -34,12 +34,15 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v4
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
22 changes: 14 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@v4
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,13 +105,16 @@ 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
rm -f .coverage.*
ls -la
git status --porcelain
test -z "$(git status --porcelain)"
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@v4
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
21 changes: 12 additions & 9 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 @@ -32,48 +32,51 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v4
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: Test docs entry point
if: inputs.test-type == 'everest-docs-entry-test'
run: |
python -m everest.docs
uv run python -m everest.docs

- 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 All @@ -35,10 +35,13 @@ jobs:

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

- name: Install ert
run: |
uv pip install .
uv sync

- name: Get semeio
run: |
Expand All @@ -47,5 +50,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
Loading