Skip to content

Commit f5edaf1

Browse files
Felixoidsylvestre
authored andcommitted
Group tests logging in CI
1 parent 79af5e7 commit f5edaf1

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/integration/Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ else
2222
export SCCACHE_PATH := /sccache/target/debug/sccache
2323
endif
2424

25+
# CI grouping helpers (GitHub Actions folding)
26+
ifdef CI
27+
group = @echo '::group::$(1)'
28+
endgroup = @echo '::endgroup::'
29+
else
30+
group =
31+
endgroup =
32+
endif
33+
2534
BACKENDS := redis redis-deprecated memcached memcached-deprecated s3 azblob webdav basedirs
2635
TOOLS := gcc clang cmake cmake-modules cmake-modules-v4 autotools coverage zstd
2736

@@ -112,6 +121,7 @@ $(COVERAGE_DIR)/profraw:
112121
@mkdir -p $@
113122

114123
$(SCCACHE_BIN): $(PROJECT_ROOT)/Cargo.toml $(PROJECT_ROOT)/Cargo.lock
124+
$(call group,Building $*)
115125
ifdef WITH_COVERAGE
116126
@echo "Building sccache with coverage instrumentation in Docker..."
117127
else
@@ -129,6 +139,7 @@ endif
129139
chown -R $(UID):$(GID) target"
130140
@echo "Binary built: $(SCCACHE_BIN)"
131141
@ls -lh $(SCCACHE_BIN)
142+
$(call endgroup)
132143

133144
define profiles
134145
$(foreach profile,$(PROFILES_$(1)),--profile $(profile))
@@ -140,11 +151,13 @@ clean-%:
140151

141152
# Pattern rule for testing backends
142153
test-%: build clean-%
143-
@echo "Testing $* backend..."
154+
$(call group,Testing $*)
155+
@echo "Testing $*..."
144156
@docker compose $(call profiles,$*) up --quiet-pull -d $(SERVICES_$*)
145157
@docker compose $(call profiles,$*) run --quiet-pull --rm test-$*
146158
@docker compose $(call profiles,$*) down
147159
@echo "$* test completed"
160+
$(call endgroup)
148161

149162
test-backends: $(addprefix test-,$(BACKENDS))
150163
@echo "All backend tests completed"
@@ -167,6 +180,7 @@ coverage-report:
167180
echo "Run tests with: WITH_COVERAGE=1 make test-<name>"; \
168181
exit 1; \
169182
fi
183+
$(call group,Generating coverage report)
170184
@echo "Generating coverage report..."
171185
@docker run --rm \
172186
-v $(PROJECT_ROOT):/sccache \
@@ -189,6 +203,7 @@ coverage-report:
189203
--ignore 'build.rs' \
190204
--excl-br-line '^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()' && \
191205
chown -R $(UID):$(GID) target/integration-coverage"
206+
$(call endgroup)
192207
@echo ""
193208
@echo "Coverage report generated:"
194209
@echo " $(PROJECT_ROOT)/target/integration-coverage/reports/lcov.info"

0 commit comments

Comments
 (0)