Skip to content

Commit

Permalink
[CI] Add runtime tests. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazeem authored Dec 26, 2022
1 parent d5d9433 commit 9919190
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ jobs:
STRIP: strip
BUILD_DIR: ${{ env.AMD64_LINUX_PREFIX }}
TAR: ${{ env.AMD64_LINUX_PREFIX_TAR }}
run: ./scripts/ci-build.sh
run: |
./scripts/ci-build.sh
./tests/test.sh
- name: Build (${{ env.ARM64_LINUX_PREFIX }})
if: runner.os == 'Linux'
Expand All @@ -154,7 +156,9 @@ jobs:
STRIP: strip
BUILD_DIR: ${{ env.AMD64_MACOSX_PREFIX }}
TAR: ${{ env.AMD64_MACOSX_PREFIX_TAR }}
run: ./scripts/ci-build.sh
run: |
./scripts/ci-build.sh
./tests/test.sh
# --- Upload ---

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/source/dir1/file.10
Binary file not shown.
Binary file added tests/source/dir1/file.20
Binary file not shown.
Binary file added tests/source/dir1/file.30
Binary file not shown.
Binary file added tests/source/dir1/file.40
Binary file not shown.
Binary file added tests/source/dir2/file.50
Binary file not shown.
Binary file added tests/source/dir2/file.60
Binary file not shown.
Binary file added tests/source/dir2/file.70
Binary file not shown.
Binary file added tests/source/dir2/file.80
Binary file not shown.
Binary file added tests/source/dir3/file.90
Binary file not shown.
Binary file added tests/source/file.100
Binary file not shown.
21 changes: 21 additions & 0 deletions tests/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

BUILD_DIR=${BUILD_DIR:-build}

SOURCE_DIR="./tests/source"
EXPECTED_DEST_DIR="./tests/expected-destination"
ACTUAL_DEST_DIR="/tmp/actual-destination"

rm -rf $ACTUAL_DEST_DIR
mkdir -p $ACTUAL_DEST_DIR

"$BUILD_DIR"/spancopy --threshold 100 --source $SOURCE_DIR --destination $ACTUAL_DEST_DIR

EXPECTED_DEST_SUBDIR=$(ls $EXPECTED_DEST_DIR | tr -d '\n')
ACTUAL_DEST_SUBDIR=$(ls $ACTUAL_DEST_DIR | tr -d '\n')

if diff -r "$EXPECTED_DEST_DIR/$EXPECTED_DEST_SUBDIR" "$ACTUAL_DEST_DIR/$ACTUAL_DEST_SUBDIR"; then
rm -rf $ACTUAL_DEST_DIR
fi

0 comments on commit 9919190

Please sign in to comment.