Skip to content

Commit

Permalink
Merge pull request #909 from utam0k/improvement/Makefile
Browse files Browse the repository at this point in the history
Remove the build dependency from some tests.
  • Loading branch information
utam0k authored May 25, 2022
2 parents 1db7de3 + 0758953 commit cdcef4a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_execution_time.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
profile: minimal

- name: Building PR branch
run: ./build.sh --release
run: make release-build

- name: Uploading PR build to artifact
uses: actions/upload-artifact@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration_tests_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ jobs:
sudo chmod 755 /usr/bin/runc
- name: Validate tests on runc
run: make validate-rust-tests
- name: Build
run: make release-build
- name: Validate tests on youki
run: make integration-test
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,7 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: "1.17.6"
- name: Build
run: make release-build
- name: Run integration tests
run: make oci-integration-test
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
with:
toolchain: stable
override: true
- name: Build
run: make release-build
- name: test
run: make test-all

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ test-all: test oci-integration-test integration-test
test: build
cd crates && cargo test

oci-integration-test: release-build
oci-integration-test:
./scripts/oci_integration_tests.sh $(ROOT)

integration-test: release-build
integration-test:
./scripts/rust_integration_tests.sh $(ROOT)/youki

validate-rust-tests: release-build
validate-rust-tests:
./scripts/rust_integration_tests.sh runc

clean:
Expand Down
7 changes: 7 additions & 0 deletions scripts/oci_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ check_environment() {
fi
}

if [[ ! -e $RUNTIME ]]; then
if ! which $RUNTIME ; then
echo "$RUNTIME not found"
exit 1
fi
fi

for case in "${test_cases[@]}"; do
if [[ ! -e "${OCI_TEST_DIR}/validation/$case" ]]; then
GO111MODULE=auto GOPATH=${ROOT}/tests/oci-runtime-tests make runtimetest validation-executables
Expand Down
13 changes: 11 additions & 2 deletions scripts/rust_integration_tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#! /bin/sh -eu

ROOT=$(git rev-parse --show-toplevel)
RUNTIME=$1

if [ "$1" = "" ]; then
if [ "$RUNTIME" = "" ]; then
echo "please specify runtime"
exit 1
fi

if [ ! -e $RUNTIME ]; then
if ! which $RUNTIME ; then
echo "$RUNTIME not found"
exit 1
fi
fi

ROOT=${2-$(git rev-parse --show-toplevel)}

LOGFILE="${ROOT}/test.log"
Expand All @@ -15,7 +24,7 @@ if [ ! -f ${ROOT}/bundle.tar.gz ]; then
fi
touch ${LOGFILE}

sudo YOUKI_LOG_LEVEL="error" ${ROOT}/integration_test run --runtime "$1" --runtimetest ${ROOT}/runtimetest > $LOGFILE
sudo YOUKI_LOG_LEVEL="error" ${ROOT}/integration_test run --runtime "$RUNTIME" --runtimetest ${ROOT}/runtimetest > $LOGFILE

if [ 0 -ne $(grep "not ok" $LOGFILE | wc -l ) ]; then
cat $LOGFILE
Expand Down

0 comments on commit cdcef4a

Please sign in to comment.