Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "ShellCheck"

on:
pull_request:
types: [opened, reopened, synchronize]
branches: [main]

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
env:
SHELLCHECK_OPTS: -e SC2086 -e SC2154
11 changes: 5 additions & 6 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -e

die() {
echo "CI internal failure : $@" 1>&2
echo "CI internal failure : $*" 1>&2
exit 1
}

Expand Down Expand Up @@ -41,6 +41,7 @@ initialization() {
cqfd init
cqfd -b prepare
echo "Sources prepared succesfully"
exit 0
}

# Launch Debian configuration and hardening
Expand All @@ -55,6 +56,7 @@ configure_debian() {
playbooks/cluster_setup_debian.yaml \
playbooks/cluster_setup_hardened_debian.yaml
echo "Debian set up succesfully"
exit 0
}

# Prepare, launch test and upload test report
Expand Down Expand Up @@ -82,8 +84,8 @@ launch_test() {

# Upload report

PR_N=`echo $GITHUB_REF | cut -d '/' -f 3`
TIME=`date +%F_%Hh%Mm%S`
PR_N=$(echo $GITHUB_REF | cut -d '/' -f 3)
TIME=$(date +%F_%Hh%Mm%S)
REPORT_NAME=test-report_${GITHUB_RUN_ID}_${GITHUB_RUN_ATTEMPT}_${TIME}.pdf
REPORT_DIR=${WORK_DIR}/reports/docs/reports/PR-${PR_N}

Expand Down Expand Up @@ -116,15 +118,12 @@ launch_test() {
case "$1" in
init)
initialization
exit 0
;;
conf)
configure_debian
exit 0
;;
test)
launch_test
exit 0
;;
*)
usage
Expand Down
13 changes: 7 additions & 6 deletions report-generator/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ add_xml_to_adoc()
local nb_suites="$(( $(xmlstarlet sel -t -v '//testsuite/@name' "$xml"\
|wc -l) +1 ))"
for i in $(seq 1 ${nb_suites}) ; do
local testname=$(xmlstarlet sel -t -v "//testsuite[$i]/@name" "$xml")
local classname=$(xmlstarlet sel -t -v "//testsuite[$i]/testcase[1]/@classname" "$xml")
local nb_tests=$(xmlstarlet sel -t -v "//testsuite[$i]/@tests" "$xml")
local failures=$(xmlstarlet sel -t -v "//testsuite[$i]/@failures" "$xml")
local testname classname nb_tests failures
testname=$(xmlstarlet sel -t -v "//testsuite[$i]/@name" "$xml")
classname=$(xmlstarlet sel -t -v "//testsuite[$i]/testcase[1]/@classname" "$xml")
nb_tests=$(xmlstarlet sel -t -v "//testsuite[$i]/@tests" "$xml")
failures=$(xmlstarlet sel -t -v "//testsuite[$i]/@failures" "$xml")
local cols='"7,1"'
if [ -z "$testname" -o "$testname" == "default" ] ; then
if [ -z "$testname" ] || [ -o "$testname" == "default" ] ; then
testname=$(basename $xml)
fi
echo -n "=== Tests $testname" >> "$TEST_ADOC_FILE"
if [ -n "$classname" -a "$classname" != "cukinia" ] ; then
if [ -n "$classname" ] && [ "$classname" != "cukinia" ] ; then
echo -n " for $classname" >> "$TEST_ADOC_FILE"
fi
echo >> "$TEST_ADOC_FILE"
Expand Down