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

Combine running of unit and performance tests #9854

Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-type: [ 'performance-tests', 'unit-tests', 'gui-tests', 'cli-tests' ]
test-type: [ 'performance-and-unit-tests', 'gui-tests', 'cli-tests' ]
python-version: [ '3.11', '3.12' ]
os: [ ubuntu-latest ]
uses: ./.github/workflows/test_ert.yml
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-type: [ 'performance-tests', 'unit-tests', 'gui-tests', 'cli-tests' ]
test-type: [ 'performance-and-unit-tests', 'gui-tests', 'cli-tests' ]
python-version: [ '3.12' ]
os: [ 'macos-latest']

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,11 @@ jobs:
pytest -m ${{ inputs.select-string }} --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'
if: inputs.test-type == 'performance-and-unit-tests'
run: |
pytest -m ${{ inputs.select-string }} --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 -m ${{ inputs.select-string }} --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 tests/ert/performance_tests --durations=25
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 -m ${{ inputs.select-string }} --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
uses: codecov/codecov-action@v5
Expand Down
54 changes: 0 additions & 54 deletions src/_ert/async_utils.py

This file was deleted.

10 changes: 8 additions & 2 deletions tests/ert/performance_tests/test_dark_storage_performance.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import asyncio
import contextlib
import gc
import io
import os
import time
from asyncio import get_event_loop
from collections.abc import Awaitable
from datetime import datetime, timedelta
from typing import TypeVar
Expand Down Expand Up @@ -45,7 +45,13 @@ def test_escape(s: str) -> str:


def run_in_loop(coro: Awaitable[T]) -> T:
return get_event_loop().run_until_complete(coro)
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this makes sense!

loop = asyncio.get_running_loop()
except RuntimeError:
loop = asyncio.new_event_loop()

asyncio.set_event_loop(loop)
return loop.run_until_complete(coro)


def get_single_record_csv(storage, ensemble_id1, keyword, poly_ran):
Expand Down
Loading