@@ -170,6 +170,8 @@ TEST_BINARY = $(BUILD_BIN_DIR)/containerPackageTests.xctest/Contents/MacOS/conta
170170# Set of files we do not want to get caught in the coverage generation
171171LLVM_COV_IGNORE := \
172172 --ignore-filename-regex=".build/" \
173+ --ignore-filename-regex="/Tests/" \
174+ --ignore-filename-regex="/ContainerTestSupport/" \
173175 --ignore-filename-regex=".pb.swift" \
174176 --ignore-filename-regex=".proto" \
175177 --ignore-filename-regex=".grpc.swift"
@@ -194,12 +196,10 @@ define GENERATE_COV_REPORTS
194196 @cat $(COVERAGE_OUTPUT_DIR ) /$(2 ) /coverage-percent.txt
195197endef
196198
197- # New integration test infrastructure.
198199# PARALLEL_WIDTH controls --experimental-maximum-parallelization-width for the
199200# concurrent pass. WARMUP_FILTER, CONCURRENT_FILTER, and GLOBAL_FILTER select
200- # the three phases. Expand the filter lists as suites are migrated from CLITests.
201- # PARALLEL_WIDTH ?= $(shell sysctl -n hw.physicalcpu)
202- PARALLEL_WIDTH ?= 2
201+ # the three phases.
202+ PARALLEL_WIDTH ?= $(shell sysctl -n hw.physicalcpu)
203203WARMUP_FILTER = ImageWarmup/
204204
205205CONCURRENT_TEST_SUITES ?= $(sort $(addsuffix /,$(basename $(notdir \
@@ -264,27 +264,22 @@ define RUN_INTEGRATION
264264 }
265265endef
266266
267- .PHONY : integration-new
268- integration-new : init-block
267+ .PHONY : integration
268+ integration : init-block
269269 $(RUN_INTEGRATION )
270270
271- .PHONY : coverage-integration-new
272- coverage-integration-new : INTEGRATION_SWIFT_EXTRA = --skip-build --enable-code-coverage
273- coverage-integration-new : INTEGRATION_POST_TEST = cp $(COV_DATA_DIR ) /* .profraw $(COVERAGE_OUTPUT_DIR ) /integration/ ;
274- coverage-integration-new : all
271+ .PHONY : coverage-integration
272+ coverage-integration : INTEGRATION_SWIFT_EXTRA = --skip-build --enable-code-coverage
273+ coverage-integration : INTEGRATION_POST_TEST = cp $(COV_DATA_DIR ) /* .profraw $(COVERAGE_OUTPUT_DIR ) /integration/ ;
274+ coverage-integration : all
275275 @mkdir -p $(COVERAGE_OUTPUT_DIR ) /integration
276276 $(RUN_INTEGRATION )
277277
278- INTEGRATION_TEST_SUITES ?= NoTests/
279-
280278empty :=
281279space := $(empty ) $(empty )
282- INTEGRATION_FILTER := $(subst $(space ) ,|,$(strip $(INTEGRATION_TEST_SUITES ) ) )
283280
284- .PHONY : coverage-new
285- # Merges unit coverage with integration-new coverage. Use this during migration;
286- # replace coverage with coverage-new in CI until all legacy tests are removed.
287- coverage-new : coverage-build coverage-unit coverage-integration-new
281+ .PHONY : coverage
282+ coverage : coverage-build coverage-unit coverage-integration
288283 @echo Merging integration coverage profdata...
289284 @xcrun llvm-profdata merge -sparse $(COVERAGE_OUTPUT_DIR ) /integration/* .profraw -o $(COVERAGE_OUTPUT_DIR ) /integration/default.profdata
290285 $(call GENERATE_COV_REPORTS,$(COVERAGE_OUTPUT_DIR ) /integration/default.profdata,integration)
@@ -301,17 +296,6 @@ coverage-build:
301296 @echo Building tests with coverage instrumentation...
302297 @$(SWIFT ) build --build-tests --enable-code-coverage -c $(BUILD_CONFIGURATION ) $(SWIFT_CONFIGURATION )
303298
304- .PHONY : coverage
305- # Merge the raw coverage data generated from coverage-unit and coverage-integration into one unified report
306- coverage : coverage-build coverage-unit coverage-integration
307- @echo Merging combined coverage profdata...
308- @mkdir -p $(COVERAGE_OUTPUT_DIR ) /combined
309- @xcrun llvm-profdata merge -sparse \
310- $(COVERAGE_OUTPUT_DIR ) /unit/default.profdata \
311- $(COVERAGE_OUTPUT_DIR ) /integration/default.profdata \
312- -o $(COVERAGE_OUTPUT_DIR ) /combined/default.profdata
313- $(call GENERATE_COV_REPORTS,$(COVERAGE_OUTPUT_DIR ) /combined/default.profdata,combined)
314-
315299.PHONY : coverage-unit
316300coverage-unit :
317301 @echo Running unit test coverage...
@@ -322,50 +306,6 @@ coverage-unit:
322306 @xcrun llvm-profdata merge -sparse $(COV_DATA_DIR ) /* .profraw -o $(COVERAGE_OUTPUT_DIR ) /unit/default.profdata
323307 $(call GENERATE_COV_REPORTS,$(COVERAGE_OUTPUT_DIR ) /unit/default.profdata,unit)
324308
325- .PHONY : coverage-integration
326- coverage-integration : all
327- @echo Ensuring apiserver stopped before the coverage integration tests...
328- @bin/container system stop && sleep 3 && scripts/ensure-container-stopped.sh
329- @echo Running integration test coverage...
330- @rm -f $(COV_DATA_DIR ) /* .profraw
331- @mkdir -p $(COVERAGE_OUTPUT_DIR ) /integration
332- @bin/container --debug system start --timeout 60 $(SYSTEM_START_OPTS ) && \
333- echo " Starting CLI integration tests with coverage" && \
334- { \
335- export CLITEST_LOG_ROOT=$(LOG_ROOT ) ; \
336- export CONTAINER_CLI_PATH=$(ROOT_DIR ) /bin/container ; \
337- $(SWIFT ) test --skip-build --enable-code-coverage -c $(BUILD_CONFIGURATION ) $(SWIFT_CONFIGURATION ) --filter " $( INTEGRATION_FILTER) " ; \
338- exit_code=$$? ; \
339- cp $(COV_DATA_DIR ) /* .profraw $(COVERAGE_OUTPUT_DIR ) /integration/ ; \
340- echo Ensuring apiserver stopped after the coverage integration tests ; \
341- scripts/ensure-container-stopped.sh ; \
342- exit $$ {exit_code} ; \
343- }
344- @echo Merging integration coverage profdata...
345- @xcrun llvm-profdata merge -sparse $(COVERAGE_OUTPUT_DIR ) /integration/* .profraw -o $(COVERAGE_OUTPUT_DIR ) /integration/default.profdata
346- $(call GENERATE_COV_REPORTS,$(COVERAGE_OUTPUT_DIR ) /integration/default.profdata,integration)
347-
348- .PHONY : integration
349- integration : init-block
350- @echo Ensuring apiserver stopped before the CLI integration tests...
351- @bin/container system stop && sleep 3 && scripts/ensure-container-stopped.sh
352- @if [ -n " $( APP_ROOT) " ]; then \
353- echo " Clearing application data under $( APP_ROOT) (preserving kernels)..." ; \
354- mkdir -p $(APP_ROOT ) ; \
355- find " $( APP_ROOT) " -mindepth 1 -maxdepth 1 ! -name kernels -exec rm -rf {} + ; \
356- fi
357- @echo Running the integration tests...
358- @bin/container --debug system start --timeout 60 --enable-kernel-install $(SYSTEM_START_OPTS ) && \
359- echo " Starting CLI integration tests" && \
360- { \
361- CLITEST_LOG_ROOT=$(LOG_ROOT ) && export CLITEST_LOG_ROOT ; \
362- CONTAINER_CLI_PATH=$(ROOT_DIR ) /bin/container && export CONTAINER_CLI_PATH ; \
363- $(SWIFT ) test -c $(BUILD_CONFIGURATION ) $(SWIFT_CONFIGURATION ) --filter " $( INTEGRATION_FILTER) " ; \
364- exit_code=$$? ; \
365- echo Ensuring apiserver stopped after the CLI integration tests ; \
366- scripts/ensure-container-stopped.sh ; \
367- exit $$ {exit_code} ; \
368- }
369309
370310.PHONY : fmt
371311fmt : swift-fmt update-licenses
0 commit comments