Skip to content

Commit

Permalink
actions: source reference cores from gDrive
Browse files Browse the repository at this point in the history
  • Loading branch information
sdimitro committed Dec 9, 2024
1 parent 5b5e5f1 commit 51e0dac
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/download-dumps-from-gdrive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -eux

#
# Download all the reference core dumps from the public gDrive folder
# and place them in the root directory.
#
pip install gdown
gdown --folder 1fdPVuGXbxNKcMEVwhuda04hZTPCcYJms
mv SDB-Public/* .
rmdir SDB-Public
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Assumptions for this to work:
# [1] This script is executed from the root of the SDB repo
# [2] The archive downloaded from S3 has one of the following profiles:
# [2] The archive downloaded from gdrive has one of the following profiles:
# Profile A - It is lzma-compressed and has the following file structure:
# dump-data
# ├── dump.201912060006
Expand Down Expand Up @@ -33,12 +33,8 @@ if [ ! -d $DATA_DIR ]; then
exit 1
fi

if [ -f "$1" ]; then
echo "Found $1 locally, skip download ..."
else
echo "downloading of $1 from S3 ..."
wget https://sdb-testing-bucket.s3.us-west-2.amazonaws.com/$1
[ $? -eq 0 ] || exit 1
if [ ! -f "$1" ]; then
echo "error: $1: file not found"
fi

if [[ $1 == *.tar.lzma ]]; then
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
strategy:
matrix:
python-version: [3.8, 3.9]
dump: [dump.201912060006.tar.lzma, dump.202303131823.tar.gz]
env:
AWS_DEFAULT_REGION: 'us-west-2'
steps:
Expand All @@ -67,7 +66,9 @@ jobs:
- run: python3 -m pip install aws python-config pytest pytest-cov
- run: ./.github/scripts/install-libkdumpfile.sh
- run: ./.github/scripts/install-drgn.sh
- run: ./.github/scripts/download-dump-from-s3.sh ${{ matrix.dump }}
- run: ./.github/scripts/download-dumps-from-gdrive.sh
- run: ./.github/scripts/extract-dump.sh dump.201912060006.tar.lzma
- run: ./.github/scripts/extract-dump.sh dump.202303131823.tar.gz
- run: pytest -v --cov sdb --cov-report xml tests
- uses: codecov/codecov-action@v1
with:
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ $ python3 -m yapf -i --style google --recursive tests

Regression testing is currently done by downloading a refererence crash/core
dump and running a predetermined set of commads on it, ensuring that they
return the same reference output before and after your changes. To see the list
of reference crash dumps refer to the testing matrix of the `pytest` Github
action in `.github/workflows/main.yml`. Here is an example of running the
regression test commands against `dump.201912060006.tar.lzma` with code
coverage and verbose output:
return the same reference output before and after your changes.

```
$ python3 -m pip install python-config pytest pytest-cov
$ .github/scripts/download-dump-from-s3.sh dump.201912060006.tar.lzma
$ .github/scripts/download-dumps-from-gdrive.sh
$ .github/scripts/extract-dump.sh dump.201912060006.tar.lzma
$ .github/scripts/extract-dump.sh dump.202303131823.tar.gz
$ python3 -m pytest -v --cov sdb --cov-report xml tests
```

Expand Down

0 comments on commit 51e0dac

Please sign in to comment.