From 6c8af108acc5b1bc68178539301d78b26b7191d7 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 21 Jun 2024 00:54:53 -0600 Subject: [PATCH 1/3] Try to switch to llvm-cov for coverage --- .github/workflows/daily.yaml | 61 +++++++----------------------------- .github/workflows/rust.yaml | 22 ++++--------- 2 files changed, 18 insertions(+), 65 deletions(-) diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 7bf8f5d8..46b775c7 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -20,55 +20,18 @@ jobs: toolchain: stable components: rustfmt, clippy - - name: Install cargo-grcov + - name: Download data run: | - rustup component add llvm-tools-preview - cargo install grcov - - - name: Generate coverage report for unit tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test --lib && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-lib.txt - - - name: Generate coverage report for doc tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test --doc && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-docs.txt - - - name: Generate coverage report for cosmic integr. tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test -- cosmic && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-cosmic.txt - - - name: Generate coverage report for mission_design integr. tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test -- mission_design && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-mission_design.txt - - - name: Generate coverage report for OD integr. tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test -- orbit_determination::trackingarc orbit_determination::filtererrors orbit_determination::measurements orbit_determination::simulator orbit_determination::spacecraft && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-od.txt - - - name: Generate coverage report for propulsion integr. tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test -- propulsion && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-prop.txt - - - name: Generate coverage report for monte carlo integr. tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: cargo test -- test_monte_carlo_epoch && grcov . --branch --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > ${{ github.workspace }}/lcov-mc.txt - - - name: Upload coverage report + wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp + wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de438.bsp # GMAT validation cases + wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca + wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc + + - name: Generate full code coverage + run: cargo llvm-cov --lcov --output-path lcov.info + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ github.workspace }}/lcov-*.txt + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: lcov.info + fail_ci_if_error: false diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index a064fdb6..a91bafda 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -124,24 +124,14 @@ jobs: wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc - - name: Install cargo-grcov - run: | - rustup component add llvm-tools-preview - cargo install grcov - - - name: Generate coverage report for unit tests - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw" - run: | - cargo test --lib - grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-lib.txt - - - name: Upload coverage report + - name: Generate unit tests code coverage + run: cargo llvm-cov --lib --lcov --output-path lcov.info + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./lcov-*.txt + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: lcov.info + fail_ci_if_error: false release: name: Release From 18f35dbed94d23a2e89f13ce8a223bc6fa17819a Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 21 Jun 2024 00:56:36 -0600 Subject: [PATCH 2/3] Change PR template --- .github/PULL_REQUEST_TEMPLATE.md | 49 +++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 49ec0664..30935ff7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,13 +1,42 @@ -### Effects +# Summary -### If this is a new feature or a bug fix ... -- [ ] Yes, the branch I'm proposing to merge is called `issue-xyz` where `xyz` is the number of the issue. +**Summarize the proposed changes** -### If this change adds or modifies a validation case -- [ ] No. -- [ ] Yes and: - - I have coded up, or updated, an existing test case; and - - I have provided a GMAT script which confirms the result(s); and - - I have updated the `VALIDATION.md` file with the new error data between nyx and GMAT. - - I will specify the version of GMAT used for the validation. +## Architectural Changes + + + +No change + +## New Features + + + +No change + +## Improvements + + + +No change + +## Bug Fixes + + + +No change + +## Testing and validation + + + +**Detail the changes in tests, including new tests and validations** + +## Documentation + + + +This PR does not primarily deal with documentation changes. + + \ No newline at end of file From b9072be5cb78525b7ccff25939d8c41722ac2878 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 21 Jun 2024 01:16:24 -0600 Subject: [PATCH 3/3] Add the llvm-cov tool --- .github/workflows/daily.yaml | 2 ++ .github/workflows/rust.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 46b775c7..da604e59 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -27,6 +27,8 @@ jobs: wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Generate full code coverage run: cargo llvm-cov --lcov --output-path lcov.info - name: Upload coverage to Codecov diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index a91bafda..a8ac778b 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -124,6 +124,8 @@ jobs: wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Generate unit tests code coverage run: cargo llvm-cov --lib --lcov --output-path lcov.info - name: Upload coverage to Codecov