Skip to content

Commit bfe194d

Browse files
committed
The job that runs on self-hosted runners updated to use latest test logging structure.
1 parent 002acf2 commit bfe194d

1 file changed

Lines changed: 22 additions & 27 deletions

File tree

.github/workflows/ci-multi-server-tests.yml

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ jobs:
177177
- ${{ github.workspace }}:/workspace
178178

179179
env:
180-
MULTI_SERVER_TEST_RESULTS_LOG: build/tests/multi-server/freeradius-multi-server-test-runtime-logs/multi-server-test-results-combined.log
181-
MULTI_SERVER_TEST_LISTENER_LOG: build/tests/multi-server/freeradius-multi-server-test-runtime-logs/multi-server-test-listener-combined.log
180+
MULTI_SERVER_ENV_DOCKER_BUILD_OS: ubuntu24
181+
MULTI_SERVER_TEST_LOG: build/tests/multi-server/freeradius-multi-server-test-runtime-logs/multi-server-test.log
182+
MULTI_SERVER_TEST_LISTENER_LOG: build/tests/multi-server/freeradius-multi-server-test-runtime-logs/multi-server-test-linelog-msg-output.log
182183

183184
container:
184185
image: docker.internal.networkradius.com/self-hosted
@@ -224,8 +225,8 @@ jobs:
224225
225226
- name: Build Docker image from source
226227
run: |
227-
make docker.ubuntu24.build
228-
docker tag freeradius4/ubuntu24:latest freeradius-build:latest
228+
make docker.${MULTI_SERVER_ENV_DOCKER_BUILD_OS}.build
229+
docker tag freeradius4/${MULTI_SERVER_ENV_DOCKER_BUILD_OS}:latest freeradius-build:latest
229230
docker images --all
230231
231232
- name: Run multi-server tests
@@ -242,30 +243,25 @@ jobs:
242243
run: |
243244
set -euo pipefail
244245
245-
echo "============ ${MULTI_SERVER_TEST_RESULTS_LOG} ============"
246-
cat "${MULTI_SERVER_TEST_RESULTS_LOG}"
247-
248-
if grep -q '\[Failed\]' "${MULTI_SERVER_TEST_RESULTS_LOG}"; then
249-
echo "TEST FAILED: Found [Failed] in log"
250-
grep '\[Failed\]' "${MULTI_SERVER_TEST_RESULTS_LOG}"
251-
252-
# Display the framework's listener log for debugging purposes
253-
echo "============ ${MULTI_SERVER_TEST_LISTENER_LOG} ============"
254-
cat "${MULTI_SERVER_TEST_LISTENER_LOG}"
255-
exit 1
256-
fi
246+
echo "${MULTI_SERVER_TEST_LOG}:"
247+
cat "${MULTI_SERVER_TEST_LOG}"
257248
258-
if grep -Eq '\(Failures:[[:space:]]*[1-9][0-9]*[[:space:]]*\)' "${MULTI_SERVER_TEST_RESULTS_LOG}"; then
259-
echo "TEST FAILED: Found Failures > 0 in log"
260-
grep -E '\(Failures:[[:space:]]*[1-9][0-9]*[[:space:]]*\)' "${MULTI_SERVER_TEST_RESULTS_LOG}"
249+
if grep -Eq "\(Failures:[^0-9]*[1-9][0-9]*\)" "${MULTI_SERVER_TEST_LOG}"; then
250+
echo "TEST FAILED: Found > 0 failures in log"
261251
262-
# Display the framework's listener log for debugging purposes
263-
echo "============ ${MULTI_SERVER_TEST_LISTENER_LOG} ============"
252+
# Display the test's linelog message file
253+
echo "${MULTI_SERVER_TEST_LISTENER_LOG}:"
264254
cat "${MULTI_SERVER_TEST_LISTENER_LOG}"
265255
exit 1
266256
fi
267257
268-
log="${MULTI_SERVER_TEST_RESULTS_LOG}"
258+
# Verify that all of the expected linelog results were matched
259+
# during the test(s).
260+
#
261+
# Checking to see that the <actual> value matches <expected> value in lines like:
262+
#
263+
# Matched: <actual> / <expected> (Failures: 0)
264+
#
269265
if awk '
270266
BEGIN { found=0; n1=0; n2=0; line="" }
271267
index($0,"Matched:") {
@@ -285,14 +281,13 @@ jobs:
285281
if (found) { printf "MATCH: %d / %d\nMatched line: %s\n", n1, n2, line; exit 0 }
286282
exit 1
287283
}
288-
' "$log"
284+
' "${MULTI_SERVER_TEST_LOG}"
289285
then
290286
: # PASS
291287
else
292-
echo "TEST FAILED: No Matched line found with equal non-zero counts"
293-
294-
# Display the framework's listener log for debugging purposes
295-
echo "============ ${MULTI_SERVER_TEST_LISTENER_LOG} ============"
288+
echo "TEST FAILED: Detected issues with the test's linelog message logs"
289+
# Display the test's linelog message file
290+
echo "${MULTI_SERVER_TEST_LISTENER_LOG}:"
296291
cat "${MULTI_SERVER_TEST_LISTENER_LOG}"
297292
exit 1
298293
fi

0 commit comments

Comments
 (0)