From 94ca6e79041fb8a196cec6287ef189314fd1d88a Mon Sep 17 00:00:00 2001 From: Heorhii Azarov Date: Mon, 5 Feb 2024 12:25:04 +0200 Subject: [PATCH 01/10] Increase coverage partitions to 6 --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0e37366a86..a73c8834c4 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 5 + PARTITIONS_COUNT: 6 jobs: coverage: @@ -19,7 +19,7 @@ jobs: strategy: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: [0, 1, 2, 3, 4] + partition: [0, 1, 2, 3, 4, 5] steps: - name: Install dependencies From fbbccdc4ffad381d703c8384eed6a9bed205aad5 Mon Sep 17 00:00:00 2001 From: Heorhii Azarov Date: Mon, 5 Feb 2024 12:41:45 +0200 Subject: [PATCH 02/10] Increase coverage partitions to 7 --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a73c8834c4..f047d231b2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 6 + PARTITIONS_COUNT: 7 jobs: coverage: @@ -19,7 +19,7 @@ jobs: strategy: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: [0, 1, 2, 3, 4, 5] + partition: [0, 1, 2, 3, 4, 5, 6] steps: - name: Install dependencies From dccc23ddfd193ba4a58d6c74c8dad7736dfa7c94 Mon Sep 17 00:00:00 2001 From: Heorhii Azarov Date: Mon, 5 Feb 2024 12:57:02 +0200 Subject: [PATCH 03/10] Increase coverage partitions to 8 --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f047d231b2..6547fd2c08 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 7 + PARTITIONS_COUNT: 8 jobs: coverage: @@ -19,7 +19,7 @@ jobs: strategy: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: [0, 1, 2, 3, 4, 5, 6] + partition: [0, 1, 2, 3, 4, 5, 6, 7] steps: - name: Install dependencies From d76050178a22c6723aee4b3c2b159976a019fa57 Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 16:50:41 +0400 Subject: [PATCH 04/10] Increase partitions to 10 --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6547fd2c08..c519f1b217 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 8 + PARTITIONS_COUNT: 10 jobs: coverage: @@ -19,7 +19,7 @@ jobs: strategy: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: [0, 1, 2, 3, 4, 5, 6, 7] + partition: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] steps: - name: Install dependencies From 9c4ad2f9493eb947abeec84337bd82b1cb64d9b4 Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 17:36:01 +0400 Subject: [PATCH 05/10] Increase partition count to 15 --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c519f1b217..afdda7dea2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 10 + PARTITIONS_COUNT: 15 jobs: coverage: @@ -19,7 +19,7 @@ jobs: strategy: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + partition: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] steps: - name: Install dependencies From 6cdbe3458848322cb5dd6bbb22348c774166e814 Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 18:10:48 +0400 Subject: [PATCH 06/10] Increase partition count to 20 --- .github/workflows/coverage.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index afdda7dea2..36c6eb2224 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 15 + PARTITIONS_COUNT: 20 jobs: coverage: @@ -19,7 +19,8 @@ jobs: strategy: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] + partition: + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] steps: - name: Install dependencies From dc79002587efcdaf29488506b54047163031d48a Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 18:50:45 +0400 Subject: [PATCH 07/10] Remove grouping of directories and crates in an attempt to save coverage in CI --- build-tools/workspace-partition.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-tools/workspace-partition.py b/build-tools/workspace-partition.py index 071ac6f70b..ac412b2965 100644 --- a/build-tools/workspace-partition.py +++ b/build-tools/workspace-partition.py @@ -48,7 +48,8 @@ def partition_workspace(m, n): raise Exception("No members found in the workspace.") # Group crates based on directory structure using directory separators - crate_directory_groups = group_crates_by_first_directory(members) + # This was disabled because we still are having disk-space issues + # crate_directory_groups = group_crates_by_first_directory(members) # Calculate elements per partition and remainder based on the number of crate directories total_directories = len(crate_directory_groups) From d869bd133fff7c48f651bdd1d5268df1d03e9659 Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 19:03:58 +0400 Subject: [PATCH 08/10] Fix groupings in workspace-partition.py --- build-tools/workspace-partition.py | 33 +++++++++++++++++++----------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/build-tools/workspace-partition.py b/build-tools/workspace-partition.py index ac412b2965..2de7328636 100644 --- a/build-tools/workspace-partition.py +++ b/build-tools/workspace-partition.py @@ -17,22 +17,31 @@ def get_package_name(crate_dir): else: raise Exception("Cargo.toml not found for crate {}.".format(crate_dir)) -def group_crates_by_first_directory(members): +def group_crates_by_first_directory(members, do_group: bool): ''' Here we ensure that all crates in the same directory are grouped together, to minimize fracturing of coverage. We assume here that crates are tested within their directory. This is a fair assumption since we put test-suites in the same directory as the crate they are testing. + + This can be disabled with do_group boolean. In that case, groups will be the same crate dirs. ''' - crate_groups = {} - for crate_dir in members: - # Split the path name with the directory separator - dir_parts = crate_dir.split(os.path.sep) - if dir_parts: - # Group crates by the first element and join them back using the separator - dir_name = os.path.sep.join(dir_parts[:1]) - if dir_name not in crate_groups: - crate_groups[dir_name] = [] - crate_groups[dir_name].append(crate_dir) + + if do_group: + crate_groups = {} + for crate_dir in members: + # Split the path name with the directory separator + dir_parts = crate_dir.split(os.path.sep) + if dir_parts: + # Group crates by the first element and join them back using the separator + dir_name = os.path.sep.join(dir_parts[:1]) + if dir_name not in crate_groups: + crate_groups[dir_name] = [] + crate_groups[dir_name].append(crate_dir) + else: + crate_groups = {} + for crate_dir in members: + crate_groups[crate_dir] = [] + crate_groups[crate_dir].append(crate_dir) return crate_groups def partition_workspace(m, n): @@ -49,7 +58,7 @@ def partition_workspace(m, n): # Group crates based on directory structure using directory separators # This was disabled because we still are having disk-space issues - # crate_directory_groups = group_crates_by_first_directory(members) + crate_directory_groups = group_crates_by_first_directory(members, False) # Calculate elements per partition and remainder based on the number of crate directories total_directories = len(crate_directory_groups) From f70124697f11ec63f4dc0e8ffaa9b3722632a6d6 Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 19:20:17 +0400 Subject: [PATCH 09/10] Increase partition count to 30 --- .github/workflows/coverage.yml | 35 ++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 36c6eb2224..7ce2584937 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ name: Code Coverage env: # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 20 + PARTITIONS_COUNT: 30 jobs: coverage: @@ -20,7 +20,38 @@ jobs: matrix: # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) partition: - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + ] steps: - name: Install dependencies From cb6b864cbcf96d93940370a3950d869d5867f271 Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Mon, 5 Feb 2024 20:26:46 +0400 Subject: [PATCH 10/10] Disable coverage --- .github/workflows/coverage.yml | 136 ++++++++++++++++----------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7ce2584937..81e2a42f18 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,76 +1,76 @@ -on: - push: - branches: - - "**" # target all branches - pull_request: - branches: - - master +# on: +# push: +# branches: +# - "**" # target all branches +# pull_request: +# branches: +# - master -name: Code Coverage +# name: Code Coverage -env: - # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner - PARTITIONS_COUNT: 30 +# env: +# # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner +# PARTITIONS_COUNT: 30 -jobs: - coverage: - runs-on: ubuntu-latest +# jobs: +# coverage: +# runs-on: ubuntu-latest - strategy: - matrix: - # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) - partition: - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - ] +# strategy: +# matrix: +# # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above) +# partition: +# [ +# 0, +# 1, +# 2, +# 3, +# 4, +# 5, +# 6, +# 7, +# 8, +# 9, +# 10, +# 11, +# 12, +# 13, +# 14, +# 15, +# 16, +# 17, +# 18, +# 19, +# 20, +# 21, +# 22, +# 23, +# 24, +# 25, +# 26, +# 27, +# 28, +# 29, +# ] - steps: - - name: Install dependencies - run: sudo apt-get install -yqq build-essential libgtk-3-dev python3 python3-toml - - uses: actions/checkout@v1 - - name: Install rust - run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2023-11-01 - - name: Run cargo clean - run: cargo clean - - name: Install grcov from cargo - run: cargo install grcov +# steps: +# - name: Install dependencies +# run: sudo apt-get install -yqq build-essential libgtk-3-dev python3 python3-toml +# - uses: actions/checkout@v1 +# - name: Install rust +# run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2023-11-01 +# - name: Run cargo clean +# run: cargo clean +# - name: Install grcov from cargo +# run: cargo install grcov - - name: Run coverage tests - run: python3 build-tools/workspace-partition.py ${{ env.PARTITIONS_COUNT }} ${{ matrix.partition }} | xargs -I {} sh -c 'CARGO_INCREMENTAL=0 RUST_BACKTRACE=full RUST_LOG=debug RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTDOCFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTUP_TOOLCHAIN=nightly-2023-11-01 cargo test' +# - name: Run coverage tests +# run: python3 build-tools/workspace-partition.py ${{ env.PARTITIONS_COUNT }} ${{ matrix.partition }} | xargs -I {} sh -c 'CARGO_INCREMENTAL=0 RUST_BACKTRACE=full RUST_LOG=debug RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTDOCFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTUP_TOOLCHAIN=nightly-2023-11-01 cargo test' - - name: Collect coverage data with grcov - run: grcov . --source-dir . --output-type lcov --branch --ignore-not-existing --binary-path ./target/debug/ -o grcov-report-${{ matrix.partition }} +# - name: Collect coverage data with grcov +# run: grcov . --source-dir . --output-type lcov --branch --ignore-not-existing --binary-path ./target/debug/ -o grcov-report-${{ matrix.partition }} - - uses: actions/upload-artifact@v2 - with: - name: code-coverage-report-${{ matrix.partition }} - path: grcov-report-${{ matrix.partition }} +# - uses: actions/upload-artifact@v2 +# with: +# name: code-coverage-report-${{ matrix.partition }} +# path: grcov-report-${{ matrix.partition }}