Skip to content

Commit

Permalink
ci/nightly: Run parsec-mock for coverage tests
Browse files Browse the repository at this point in the history
This commit fixes nightly issues:
Certain tests ran by coverage.sh require a mock service to have
started before the tests are actually ran.

 * Clone and start the parsec-mock service for coverage testing.

Signed-off-by: Tomás González <[email protected]>
  • Loading branch information
tgonzalezorlandoarm authored and gowthamsk-arm committed Oct 6, 2023
1 parent 03c9448 commit 4a1b496
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ jobs:
with:
ref: "${{ github.event.inputs.rev }}"
- name: Execute tarpaulin
run: ./tests/coverage.sh
run: |
curl -s -N -L https://github.com/parallaxsecond/parsec-mock/archive/refs/tags/0.1.1.tar.gz | tar xz
cd parsec-mock-0.1.1/
python -m pip install --upgrade pip
pip install -r requirements.txt
cd ..
./tests/coverage.sh
15 changes: 15 additions & 0 deletions tests/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ set -euf -o pipefail

cargo install cargo-tarpaulin

######################
# Start Mock Service #
######################
CURRENT_PATH=$(pwd)
cd parsec-mock-0.1.1
python parsec_mock/parsec_mock.py --parsec-socket $CURRENT_PATH/parsec_mock.sock &
while [[ ! -S $CURRENT_PATH/parsec_mock.sock ]]; do
sleep 5
done
cd ..
export PARSEC_SERVICE_ENDPOINT="unix://$CURRENT_PATH/parsec_mock.sock"

######################
# Run tests #
######################
cargo tarpaulin --tests --out Xml --exclude-files="src/core/testing/*"

bash <(curl -s https://codecov.io/bash)

0 comments on commit 4a1b496

Please sign in to comment.