Skip to content

Commit

Permalink
chore: get test kubechat test result
Browse files Browse the repository at this point in the history
  • Loading branch information
JashBook committed Nov 17, 2023
1 parent 6889bda commit 7513158
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-kbcli-k3s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
github-token: ${{ env.GITHUB_TOKEN }}
k3d-args: --no-lb --k3s-node-label topology.hostpath.csi/node=k3d-${{ env.K3D_NAME }}-server-0@server:0

- name: run kbcli test
- name: run test ${{ inputs.test-type-name }}
id: kbcli_test_k3s
run: |
file_log_install="$(date +%Y-%m-%d-%T)".log
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-kbcli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
--zone ${{ inputs.region }} \
--project ${{ vars.GOOGLE_PROJECT }}
- name: run kbcli test
- name: run test ${{ inputs.test-type-name }}
id: kbcli_test
run: |
file_log="$(date +%Y-%m-%d-%T)".log
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/test-kubechat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
name: test ${{ inputs.test-type-name }}
runs-on: ubuntu-latest
outputs:
test-result: ${{ steps.test_kubechat.outputs.test-result }}
test-result: ${{ steps.test_result.outputs.test-result }}
steps:
- name: checkout testinfra
uses: actions/checkout@v4
Expand Down Expand Up @@ -133,6 +133,7 @@ jobs:
run: |
file_log="$(date +%Y-%m-%d-%T)".log
touch ${file_log}
echo 'FILE_LOG='${file_log} >> $GITHUB_ENV
echo "k8s-cluster-name:${{ inputs.k8s-cluster-name }}"
cmd="bash .github/utils/kubechat-test.sh "
Expand Down Expand Up @@ -162,14 +163,6 @@ jobs:
fi
echo "$cmd"
eval "$cmd" | tee -a ${file_log}
test_ret="$( grep "【FAILED】" ${file_log}|| true )"
if [[ -n "$test_ret" ]]; then
echo test-result=[FAILED] >> $GITHUB_OUTPUT
exit 1
else
echo test-result=[PASSED] >> $GITHUB_OUTPUT
fi
- name: checkout customsuites code
if: ${{ inputs.test-type != '0' }}
Expand All @@ -190,14 +183,18 @@ jobs:
run: |
file_log="$(date +%Y-%m-%d-%T)".log
touch ${file_log}
echo 'FILE_LOG='${file_log} >> $GITHUB_ENV
cd customsuites
pip3 install -r requirements.txt
python3 infratest.py --type 7 | tee -a ${file_log}
test_ret="$( grep "【FAILED】" ${file_log}|| true )"
if [[ -n "$test_ret" ]]; then
echo test-result=[FAILED] >> $GITHUB_OUTPUT
exit 1
else
echo test-result=[PASSED] >> $GITHUB_OUTPUT
fi
- name: return kubechat test result
id: test_result
run: |
test_ret="$( grep "【FAILED】" ${FILE_LOG} || true )"
if [[ -n "$test_ret" ]]; then
echo test-result=[FAILED] >> $GITHUB_OUTPUT
exit 1
else
echo test-result=[PASSED] >> $GITHUB_OUTPUT
fi

0 comments on commit 7513158

Please sign in to comment.