Skip to content

Commit

Permalink
Remove profiler and split arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Jun 27, 2023
1 parent f1d2655 commit 111ac2e
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 124 deletions.
58 changes: 0 additions & 58 deletions .github/actions/profile/action.yml

This file was deleted.

10 changes: 2 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,11 @@ jobs:
envFile: ./.github/workflows/vars/pytest.env
expand: true

- name: Add --looptime
if: runner.os != 'Windows'
run: |
echo "PYTEST_CORE_ARGUMENTS=${PYTEST_CORE_ARGUMENTS} --looptime" >> $GITHUB_ENV
echo "PYTEST_TUNNELS_ARGUMENTS=${PYTEST_TUNNELS_ARGUMENTS} --looptime" >> $GITHUB_ENV
- name: Run Pytest with Coverage
timeout-minutes: 10
run: |
coverage run --source=./src/tribler/core -p -m pytest ${PYTEST_CORE_ARGUMENTS}
coverage run --source=./src/tribler/core -p -m pytest ${PYTEST_TUNNELS_ARGUMENTS}
coverage run --source=./src/tribler/core -p -m pytest ${PYTEST_CORE_ARGUMENTS_LINUX}
coverage run --source=./src/tribler/core -p -m pytest ${PYTEST_TUNNELS_ARGUMENTS_LINUX}
coverage combine
coverage xml
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/guitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ on:
type: string
required: false

enable-profiling:
default: false
type: boolean
required: false

ref:
default: ${{ github.ref }}
type: string
Expand Down Expand Up @@ -78,22 +73,20 @@ jobs:
envFile: ./.github/workflows/vars/pytest.env
expand: true

- name: Add --looptime
if: runner.os != 'Windows'
- name: Run GUI tests (Win)
if: runner.os == 'Windows'
run: |
echo "PYTEST_GUI_ARGUMENTS=${PYTEST_GUI_ARGUMENTS} --looptime" >> $GITHUB_ENV
pytest ${PYTEST_GUI_ARGUMENTS_WIN}
- name: Run GUI tests
if: ${{!inputs.enable-profiling}}
- name: Run GUI tests (Linux)
if: runner.os == 'Linux'
run: |
pytest ${PYTEST_GUI_ARGUMENTS}
pytest ${PYTEST_GUI_ARGUMENTS_LINUX}
- name: Run GUI tests (Profiler)
if: ${{inputs.enable-profiling}}
uses: ./.github/actions/profile
with:
artifact_name: guitests_prof.svg
arguments: ${PYTEST_GUI_ARGUMENTS}
- name: Run GUI tests (Mac)
if: runner.os == 'macOS'
run: |
pytest ${PYTEST_GUI_ARGUMENTS_MAC}
- uses: actions/upload-artifact@v3
if: always()
Expand Down
49 changes: 22 additions & 27 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ on:
type: string
required: false

enable_profiling:
default: false
type: boolean
required: false

ref:
default: ${{ github.ref }}
type: string
Expand Down Expand Up @@ -68,32 +63,32 @@ jobs:
envFile: ./.github/workflows/vars/pytest.env
expand: true

- name: Add --looptime
if: runner.os != 'Windows'
- name: Run Pytest (Win)
if: runner.os == 'Windows'
run: |
echo "PYTEST_CORE_ARGUMENTS=${PYTEST_CORE_ARGUMENTS} --looptime" >> $GITHUB_ENV
echo "PYTEST_TUNNELS_ARGUMENTS=${PYTEST_TUNNELS_ARGUMENTS} --looptime" >> $GITHUB_ENV
pytest ${PYTEST_CORE_ARGUMENTS_WIN}
- name: Run Pytest
if: ${{!inputs.enable_profiling}}
- name: Run Pytest (Linux)
if: runner.os == 'Linux'
run: |
pytest ${PYTEST_CORE_ARGUMENTS}
pytest ${PYTEST_CORE_ARGUMENTS_LINUX}
- name: Run Pytest (Profiler)
if: ${{inputs.enable_profiling}}
uses: ./.github/actions/profile
with:
artifact_name: pytest_prof.svg
arguments: ${PYTEST_CORE_ARGUMENTS}
- name: Run Pytest (Mac)
if: runner.os == 'macOS'
run: |
pytest ${PYTEST_CORE_ARGUMENTS_MAC}
- name: Run Tunnels Tests
if: ${{!inputs.enable_profiling}}
- name: Run Tunnels Tests (Win)
if: runner.os == 'Windows'
run: |
pytest ${PYTEST_TUNNELS_ARGUMENTS}
pytest ${PYTEST_TUNNELS_ARGUMENTS_WIN}
- name: Run Tunnel Tests (Profiler)
if: ${{inputs.enable_profiling}}
uses: ./.github/actions/profile
with:
artifact_name: tunneltest_prof.svg
arguments: ${PYTEST_TUNNELS_ARGUMENTS}
- name: Run Tunnels Tests (Linux)
if: runner.os == 'Linux'
run: |
pytest ${PYTEST_TUNNELS_ARGUMENTS_LINUX}
- name: Run Tunnels Tests (Mac)
if: runner.os == 'macOS'
run: |
pytest ${PYTEST_TUNNELS_ARGUMENTS_MAC}
35 changes: 25 additions & 10 deletions .github/workflows/pytest_custom_ipv8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,33 @@ jobs:
envFile: ./.github/workflows/vars/pytest.env
expand: true

- name: Add --looptime
if: runner.os != 'Windows'
- name: Run Pytest (Win)
if: runner.os == 'Windows'
run: |
pytest ${PYTEST_CORE_ARGUMENTS_WIN}
- name: Run Pytest (Linux)
if: runner.os == 'Linux'
run: |
pytest ${PYTEST_CORE_ARGUMENTS_LINUX}
- name: Run Pytest (Mac)
if: runner.os == 'macOS'
run: |
pytest ${PYTEST_CORE_ARGUMENTS_MAC}
- name: Run Tunnels Tests (Win)
if: runner.os == 'Windows'
run: |
echo "PYTEST_CORE_ARGUMENTS=${PYTEST_CORE_ARGUMENTS} --looptime" >> $GITHUB_ENV
echo "PYTEST_TUNNELS_ARGUMENTS=${PYTEST_TUNNELS_ARGUMENTS} --looptime" >> $GITHUB_ENV
pytest ${PYTEST_TUNNELS_ARGUMENTS_WIN}
- name: Run Pytest
if: ${{!inputs.enable_profiling}}
- name: Run Tunnels Tests (Linux)
if: runner.os == 'Linux'
run: |
pytest ${PYTEST_CORE_ARGUMENTS}
pytest ${PYTEST_TUNNELS_ARGUMENTS_LINUX}
- name: Run Tunnels Tests
if: ${{!inputs.enable_profiling}}
- name: Run Tunnels Tests (Mac)
if: runner.os == 'macOS'
run: |
pytest ${PYTEST_TUNNELS_ARGUMENTS}
pytest ${PYTEST_TUNNELS_ARGUMENTS_MAC}
19 changes: 15 additions & 4 deletions .github/workflows/vars/pytest.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
PYTEST_COMMON_ARGUMENTS='--randomly-seed=1 --disable-warnings --reruns 1 --reruns-delay 1 --verbose --durations=3'
PYTEST_ARGUMENTS='--randomly-seed=1 --disable-warnings --reruns 1 --reruns-delay 1 --verbose --durations=3'

PYTEST_CORE_ARGUMENTS='./src/tribler/core ${PYTEST_COMMON_ARGUMENTS}'
PYTEST_TUNNELS_ARGUMENTS='./src/tribler/core/components/tunnel/tests/test_full_session --tunneltests ${PYTEST_COMMON_ARGUMENTS}'
PYTEST_GUI_ARGUMENTS='./src/tribler/gui --guitests ${PYTEST_COMMON_ARGUMENTS}'
PYTEST_CORE_ARGUMENTS='./src/tribler/core ${PYTEST_ARGUMENTS}'
PYTEST_CORE_ARGUMENTS_WIN='${PYTEST_CORE_ARGUMENTS}'
PYTEST_CORE_ARGUMENTS_LINUX='${PYTEST_CORE_ARGUMENTS} --looptime'
PYTEST_CORE_ARGUMENTS_MAC='${PYTEST_CORE_ARGUMENTS} --looptime'

PYTEST_TUNNELS_ARGUMENTS='./src/tribler/core/components/tunnel/tests/test_full_session --tunneltests ${PYTEST_ARGUMENTS}'
PYTEST_TUNNELS_ARGUMENTS_WIN='${PYTEST_TUNNELS_ARGUMENTS}'
PYTEST_TUNNELS_ARGUMENTS_LINUX='${PYTEST_TUNNELS_ARGUMENTS} --looptime'
PYTEST_TUNNELS_ARGUMENTS_MAC='${PYTEST_TUNNELS_ARGUMENTS} --looptime'

PYTEST_GUI_ARGUMENTS='./src/tribler/gui --guitests ${PYTEST_ARGUMENTS}'
PYTEST_GUI_ARGUMENTS_WIN='${PYTEST_GUI_ARGUMENTS}'
PYTEST_GUI_ARGUMENTS_LINUX='${PYTEST_GUI_ARGUMENTS} --looptime'
PYTEST_GUI_ARGUMENTS_MAC='${PYTEST_GUI_ARGUMENTS} --looptime'

0 comments on commit 111ac2e

Please sign in to comment.