From 1f25f3dbd1854fe79015420500835440cc74b59c Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sat, 4 Dec 2021 13:36:22 -0500 Subject: [PATCH] build: Update test.sh install logic --- .github/workflows/main.yaml | 4 +- runtime/tests/Makefile | 21 +++++++++++ test.sh | 75 +++++++------------------------------ 3 files changed, 37 insertions(+), 63 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ca85b73d3..7b525aee2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -101,7 +101,7 @@ jobs: uses: actions/cache@v2 with: path: ./runtime/bin/gocr_wasm.so - key: ${{ runner.os }}-gocr2-${{ hashFiles('./runtime/tests/gocr/**', './runtime/compiletime/**') }} + key: ${{ runner.os }}-gocr2-${{ hashFiles('./runtime/tests/Makefile', './runtime/tests/gocr/**', './runtime/compiletime/**', './runtime/compiletime/memory/**') }} if: success() || failure() - name: Hyde run: | @@ -138,7 +138,7 @@ jobs: uses: actions/cache@v2 with: path: ./runtime/bin/ekf_wasm.so - key: ${{ runner.os }}-gocr2-${{ hashFiles('./runtime/tests/TinyEKF/**', './runtime/compiletime/**') }} + key: ${{ runner.os }}-gocr2-${{ hashFiles('./runtime/tests/Makefile', './runtime/tests/TinyEKF/**', './runtime/compiletime/**', './runtime/compiletime/memory/**') }} if: success() || failure() - name: EKF one iteration run: | diff --git a/runtime/tests/Makefile b/runtime/tests/Makefile index 51c4244bb..2723001e4 100644 --- a/runtime/tests/Makefile +++ b/runtime/tests/Makefile @@ -61,3 +61,24 @@ resize.wasm: ../../runtime/bin/%.so: %.so cp $^ $@ + +.PHONY: fibonacci.install +fibonacci.install: ../../runtime/bin/fibonacci_wasm.so + +.PHONY: empty.install +empty.install: ../../runtime/bin/empty_wasm.so + +.PHONY: ekf.install +ekf.install: ../../runtime/bin/ekf_wasm.so + +.PHONY: cifar10.install +cifar10.install: ../../runtime/bin/cifar10_wasm.so + +.PHONY: gocr.install +gocr.install: ../../runtime/bin/gocr_wasm.so + +.PHONY: lpd.install +lpd.install: ../../runtime/bin/lpd_wasm.so + +.PHONY: resize.install +resize.install: ../../runtime/bin/resize_wasm.so diff --git a/test.sh b/test.sh index 3e7bcaab7..5480f899d 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,6 @@ declare -ra tests=( lpd_by_plate_count bimodal concurrency - payload ) declare -a failed_tests=() @@ -32,11 +31,7 @@ declare -a failed_tests=() # OCR Tests # FIXME: OCR tests seem to sporadically fail and then work on rerun. ocr_hyde() { - # FIXME: This check is a hack because GitHub Actions is caching - # the *.so file in the destination file, not the subodule it built from - if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then - make gocr -C "$base_dir/runtime/tests" || exit 1 - fi + make gocr.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/hyde" || exit 1 ./run.sh || failed_tests+=("ocr_hyde") popd || exit 1 @@ -44,9 +39,7 @@ ocr_hyde() { } ocr_handwriting() { - if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then - make gocr -C "$base_dir/runtime/tests" || exit 1 - fi + make gocr.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/handwriting" || exit 1 ./run.sh || failed_tests+=("ocr_handwriting") popd || exit 1 @@ -54,9 +47,7 @@ ocr_handwriting() { } ocr_fivebyeight() { - if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then - make gocr -C "$base_dir/runtime/tests" || exit 1 - fi + make gocr.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/fivebyeight" || exit 1 ./run.sh || failed_tests+=("ocr_fivebyeight") popd || exit 1 @@ -64,9 +55,7 @@ ocr_fivebyeight() { } ocr_by_word() { - if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then - make gocr -C "$base_dir/runtime/tests" || exit 1 - fi + make gocr.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/by_word" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("ocr_by_word") @@ -75,9 +64,7 @@ ocr_by_word() { } ocr_by_font() { - if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then - make gocr -C "$base_dir/runtime/tests" || exit 1 - fi + make gocr.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/by_font" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("ocr_by_font") @@ -86,9 +73,7 @@ ocr_by_font() { } ocr_by_dpi() { - if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then - make gocr -C "$base_dir/runtime/tests" || exit 1 - fi + make gocr.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/by_dpi" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("ocr_by_dpi") @@ -98,9 +83,7 @@ ocr_by_dpi() { # EKF Tests ekf_by_iteration() { - if [[ ! -f "$base_dir/runtime/bin/ekf_wasm.so" ]]; then - make tinyekf -C "$base_dir/runtime/tests" || exit 1 - fi + make ekf.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ekf/by_iteration" || exit 1 ./run.sh || failed_tests+=("ekf_by_iteration") popd || exit 1 @@ -108,9 +91,7 @@ ekf_by_iteration() { } ekf_one_iteration() { - if [[ ! -f "$base_dir/runtime/bin/ekf_wasm.so" ]]; then - make tinyekf -C "$base_dir/runtime/tests" || exit 1 - fi + make ekf.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/ekf/one_iteration" || exit 1 ./run.sh || failed_tests+=("ekf_one_iteration") popd || exit 1 @@ -119,9 +100,7 @@ ekf_one_iteration() { # cifar10 Tests image_classification() { - if [[ ! -f "$base_dir/runtime/bin/cifar10_wasm.so" ]]; then - make cifar10 -C "$base_dir/runtime/tests" || exit 1 - fi + make cifar10.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/imageclassification" || exit 1 ./run.sh || failed_tests+=("image_classification") popd || exit 1 @@ -129,9 +108,7 @@ image_classification() { } image_resize() { - if [[ ! -f "$base_dir/runtime/bin/resize_wasm.so" ]]; then - make sod -C "$base_dir/runtime/tests" || exit 1 - fi + make resize.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/imageresize/test" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("image_resize") @@ -140,9 +117,7 @@ image_resize() { } image_resize_by_resolution() { - if [[ ! -f "$base_dir/runtime/bin/resize_wasm.so" ]]; then - make sod -C "$base_dir/runtime/tests" || exit 1 - fi + make resize.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/imageresize/by_resolution" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("image_resize_resolution") @@ -151,9 +126,7 @@ image_resize_by_resolution() { } lpd_by_plate_count() { - if [[ ! -f "$base_dir/runtime/bin/lpd_wasm.so" ]]; then - make sod -C "$base_dir/runtime/tests" || exit 1 - fi + make lpd.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/applications/licenseplate/by_plate_count" || exit 1 ./run.sh || failed_tests+=("lpd_by_plate_count") popd || exit 1 @@ -162,9 +135,7 @@ lpd_by_plate_count() { bimodal() { echo "Bimodal" - if [[ ! -f "$base_dir/runtime/bin/fibonacci_wasm.so" ]]; then - make rttests -C "$base_dir/runtime/tests" || exit 1 - fi + make fibonacci.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/bimodal/" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("bimodal") @@ -174,9 +145,7 @@ bimodal() { concurrency() { echo "Concurrency" - if [[ ! -f "$base_dir/runtime/bin/empty_wasm.so" ]]; then - make rttests -C "$base_dir/runtime/tests" || exit 1 - fi + make empty.install -C "$base_dir/runtime/tests" || exit 1 pushd "$base_dir/runtime/experiments/concurrency/" || exit 1 # ./install.sh || exit 1 ./run.sh || failed_tests+=("concurrency") @@ -184,22 +153,6 @@ concurrency() { return 0 } -payload() { - echo "Payload" - if [[ ! -f "$base_dir/runtime/bin/work1k_wasm.so" ]] \ - || [[ ! -f "$base_dir/runtime/bin/work10k_wasm.so" ]] \ - || [[ ! -f "$base_dir/runtime/bin/work100k_wasm.so" ]] \ - || [[ ! -f "$base_dir/runtime/bin/work1m_wasm.so" ]]; then - make rttests -C "$base_dir/runtime/tests" || exit 1 - fi - # TODO: Make Dependency "work1k_wasm.so" "work10k_wasm.so" "work100k_wasm.so" "work1m_wasm.so" - pushd "$base_dir/runtime/experiments/payload/" || exit 1 - # ./install.sh || exit 1 - ./run.sh || failed_tests+=("payload") - popd || exit 1 - return 0 -} - main() { cd "$base_dir/awsm" && cargo build --release || exit 1 make all -C "$base_dir/runtime" || exit 1