Skip to content

Commit 5cd0745

Browse files
committed
Filter mutant subjects not to run mutation tests for all the classes.
1 parent 6b6d961 commit 5cd0745

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

rails_application/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
5454
elif [ -z "$$DERIVED_NAMES" ]; then \
5555
echo "Perl command produced no output (expected if no files for node)."; \
5656
else \
57+
echo "--- DEBUG: Derived names (before subject filter): ---"; \
5758
echo "$$DERIVED_NAMES"; \
5859
fi; \
5960
echo "--- END DEBUG (perl) ---"; \
60-
SUBJECT_ARGS=$$(echo "$$DERIVED_NAMES" | xargs); \
61+
SUBJECT_PATTERNS_RAILS_APP='^(Orders|ClientOrders)'; \
62+
FILTERED_NAMES=$$(echo "$$DERIVED_NAMES" | grep -E "$$SUBJECT_PATTERNS_RAILS_APP" || true); \
63+
echo "--- DEBUG: Filtered names (after subject filter): ---"; \
64+
echo "$$FILTERED_NAMES"; \
65+
SUBJECT_ARGS=$$(echo "$$FILTERED_NAMES" | xargs); \
6166
if [ -z "$$SUBJECT_ARGS" ]; then \
62-
echo "No subjects derived for this node. Skipping."; \
67+
echo "No subjects matching .mutant.yml 'subjects' criteria found for this node. Skipping."; \
6368
else \
64-
echo "Attempting to run mutant for derived subjects (mutant should apply its own ignore rules): $$SUBJECT_ARGS"; \
69+
echo "Attempting to run mutant for filtered subjects: $$SUBJECT_ARGS"; \
6570
RAILS_ENV=test bundle exec mutant run $$SUBJECT_ARGS; \
6671
MUTANT_EXIT_CODE=$$?; \
6772
if [ $$MUTANT_EXIT_CODE -ne 0 ]; then \

0 commit comments

Comments
 (0)