Skip to content

Commit

Permalink
ci: debug why cli_test.sh not work as expected
Browse files Browse the repository at this point in the history
Signed-off-by: Eval EXEC <execvy@gmail.com>
  • Loading branch information
eval-exec committed Mar 21, 2023
1 parent 8f848b3 commit cc32378
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/ci_integration_tests_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ jobs:
cp util/app-config/src/tests/*.bats /tmp/bats_testbed/
cp util/app-config/src/tests/cli_test.sh /tmp/bats_testbed/
chmod a+x /tmp/bats_testbed/cli_test.sh
- name: Setup BATS testing framework
uses: mig4/setup-bats@v1.2.0
- name: Setup Bats libs
uses: brokenpip3/setup-bats-libs@0.1.0
with:
support-install: true
support-path: /usr/lib/bats-support
assert-install: true
assert-path: /usr/lib/bats-assert
detik-install: false
file-install: false
- name: checkout pre-synced file from ckb-asset repo
uses: actions/checkout@v3
with:
Expand All @@ -121,7 +110,14 @@ jobs:
cd /tmp/bats_testbed && ./ckb init --force && ./ckb import ckb_mainnet_4000.json
- name: run bats cases
run: |
cd /tmp/bats_testbed && ./cli_test.sh
cd /tmp/bats_testbed
git clone --depth 1 --branch v1.9.0 https://github.com/bats-core/bats-core.git bats-core/bats
git clone --depth 1 --branch v0.3.0 https://github.com/bats-core/bats-support.git bats-core/test_helper/bats-support
git clone --depth 1 --branch v2.1.0 https://github.com/bats-core/bats-assert.git bats-core/test_helper/bats-assert
sudo ./bats-core/bats/install.sh /usr/local
sudo bash ./bats-core/test_helper/bats-support/load.bash
sudo bash ./bats-core/test_helper/bats-assert/load.bash
./cli_test.sh
shell: bash
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.linux_runner_label }}
4 changes: 3 additions & 1 deletion util/app-config/src/tests/cli_test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
set -euxo pipefail

export PATH=$PATH:/tmp/bats_testbed
export BATS_LIB_PATH=/usr/lib
export CKB_DIRNAME=/tmp/bats_testbed
export TMP_DIR=/tmp

for bats_cases in *.bats; do
bats "$bats_cases"
bats --trace "$bats_cases"
ret=$?
if [ "$ret" -ne "0" ]; then
exit "$ret"
Expand Down

0 comments on commit cc32378

Please sign in to comment.