diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index fe84522e..4fde8f15 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -43,7 +43,7 @@ jobs: benchmark_attempt: needs: check_pr_status - if: needs.check_pr_status.outputs.branch-pr == '' + if: needs.check_pr_status.outputs.branch-pr == '' || github.event_name == 'push' runs-on: ubuntu-latest continue-on-error: true defaults: @@ -216,7 +216,7 @@ jobs: run: exit 1 - name: Prepare gh-pages for publishing - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/benchmark_workflow') + # if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/benchmark_workflow') run: | if git ls-remote --exit-code --heads origin gh-pages; then git fetch --depth=1 origin gh-pages @@ -228,7 +228,7 @@ jobs: fi - name: Publish benchmark data to gh-pages - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/benchmark_workflow') + # if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/benchmark_workflow') working-directory: gh-pages-benchmark-data run: | mkdir -p benchmarks/history diff --git a/tests/unit_tests/benchmarks/test_dock_area_benchmark.py b/tests/unit_tests/benchmarks/test_dock_area_benchmark.py new file mode 100644 index 00000000..7225e77f --- /dev/null +++ b/tests/unit_tests/benchmarks/test_dock_area_benchmark.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +import pytest + +from bec_widgets.widgets.containers.dock_area.dock_area import BECDockArea +from bec_widgets.widgets.plots.waveform.waveform import Waveform +from tests.unit_tests.client_mocks import mocked_client + + +@pytest.fixture +def dock_area(qtbot, mocked_client): + widget = BECDockArea(client=mocked_client) + qtbot.addWidget(widget) + qtbot.waitExposed(widget) + yield widget + + +def test_add_waveform_to_dock_area(benchmark, dock_area, qtbot, mocked_client): + """Benchmark adding a Waveform widget to an existing dock area.""" + + def add_waveform(): + dock_area.new("DarkModeButton") + return dock_area + + dock = benchmark(add_waveform) + + assert dock is not None