fix: improve functional test stability and CI reliability
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 34s
CI Code / Code Coverage (pull_request) Successful in 15m26s
CI Code / Linux (ubuntu) (pull_request) Successful in 18m15s
CI Code / Linux (debian) (pull_request) Successful in 18m27s
CI Code / Linux (arch) (pull_request) Successful in 21m9s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 34s
CI Code / Code Coverage (pull_request) Successful in 15m26s
CI Code / Linux (ubuntu) (pull_request) Successful in 18m15s
CI Code / Linux (debian) (pull_request) Successful in 18m27s
CI Code / Linux (arch) (pull_request) Successful in 21m9s
- Fix parallel test execution conflicts by moving test files to build dir - Improve error handling in ci-build.sh with proper exit codes - Update test file paths for out-of-tree build compatibility - Add test-files and test-logs to .gitignore - Add clean-functional-tests target to Makefile.am
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -62,6 +62,8 @@ tests/unittests/unittests
|
|||||||
tests/unittests/unittests.log
|
tests/unittests/unittests.log
|
||||||
tests/unittests/unittests.trs
|
tests/unittests/unittests.trs
|
||||||
test-suite.log
|
test-suite.log
|
||||||
|
test-files/
|
||||||
|
test-logs/
|
||||||
|
|
||||||
# valgrind output
|
# valgrind output
|
||||||
profval*
|
profval*
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ FUNC_TEST_GROUPS = 1 2 3 4
|
|||||||
|
|
||||||
check-functional-parallel: tests/functionaltests/functionaltests
|
check-functional-parallel: tests/functionaltests/functionaltests
|
||||||
@echo "Running functional tests in parallel ($(words $(FUNC_TEST_GROUPS)) groups)..."
|
@echo "Running functional tests in parallel ($(words $(FUNC_TEST_GROUPS)) groups)..."
|
||||||
@mkdir -p $(builddir)/test-logs
|
@mkdir -p $(builddir)/test-logs $(builddir)/test-files
|
||||||
@pids=""; \
|
@pids=""; \
|
||||||
for g in $(FUNC_TEST_GROUPS); do \
|
for g in $(FUNC_TEST_GROUPS); do \
|
||||||
./tests/functionaltests/functionaltests $$g > $(builddir)/test-logs/group$$g.log 2>&1 & \
|
./tests/functionaltests/functionaltests $$g > $(builddir)/test-logs/group$$g.log 2>&1 & \
|
||||||
@@ -372,7 +372,10 @@ clean-local:
|
|||||||
rm -f $(git_include) $(git_include).in
|
rm -f $(git_include) $(git_include).in
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: my-prof.supp
|
clean-functional-tests:
|
||||||
|
rm -rf $(builddir)/test-files $(builddir)/test-logs
|
||||||
|
|
||||||
|
.PHONY: my-prof.supp clean-functional-tests
|
||||||
my-prof.supp:
|
my-prof.supp:
|
||||||
@sed '/^# AUTO-GENERATED START/q' prof.supp > $@
|
@sed '/^# AUTO-GENERATED START/q' prof.supp > $@
|
||||||
@printf "\n\n# glib\n" >> $@
|
@printf "\n\n# glib\n" >> $@
|
||||||
|
|||||||
16
ci-build.sh
16
ci-build.sh
@@ -215,10 +215,20 @@ build_and_test() {
|
|||||||
cd "$build_dir"
|
cd "$build_dir"
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
../configure -C $features $extra_args
|
if ! ../configure -C $features $extra_args; then
|
||||||
|
echo "ERROR: configure failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
$MAKE CC="${CC}"
|
if ! $MAKE CC="${CC}"; then
|
||||||
$MAKE check-functional-parallel
|
echo "ERROR: make failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! $MAKE check-functional-parallel; then
|
||||||
|
echo "ERROR: functional tests failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
./profanity -v
|
./profanity -v
|
||||||
$MAKE clean
|
$MAKE clean
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ void
|
|||||||
_cleanup_dirs(void)
|
_cleanup_dirs(void)
|
||||||
{
|
{
|
||||||
char cmd[512];
|
char cmd[512];
|
||||||
snprintf(cmd, sizeof(cmd), "rm -rf ./tests/functionaltests/files/%d", stub_port);
|
snprintf(cmd, sizeof(cmd), "rm -rf ./test-files/%d", stub_port);
|
||||||
int res = system(cmd);
|
int res = system(cmd);
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
assert_true(FALSE);
|
assert_true(FALSE);
|
||||||
@@ -241,10 +241,11 @@ init_prof_test(void **state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate unique XDG paths based on stub_port for parallel execution
|
// Generate unique XDG paths based on stub_port for parallel execution
|
||||||
|
// Use ./test-files/ in current (build) directory for out-of-tree builds compatibility
|
||||||
snprintf(xdg_config_home, sizeof(xdg_config_home),
|
snprintf(xdg_config_home, sizeof(xdg_config_home),
|
||||||
"./tests/functionaltests/files/%d/xdg_config_home", stub_port);
|
"./test-files/%d/xdg_config_home", stub_port);
|
||||||
snprintf(xdg_data_home, sizeof(xdg_data_home),
|
snprintf(xdg_data_home, sizeof(xdg_data_home),
|
||||||
"./tests/functionaltests/files/%d/xdg_data_home", stub_port);
|
"./test-files/%d/xdg_data_home", stub_port);
|
||||||
|
|
||||||
// Give stabber server thread time to start listening
|
// Give stabber server thread time to start listening
|
||||||
usleep(100000); // 100ms
|
usleep(100000); // 100ms
|
||||||
|
|||||||
Reference in New Issue
Block a user