@@ -8,11 +8,28 @@ MUTANT_TARGET_DIRS := lib
88
99mutate :
1010ifeq ($(origin MUTANT_NODE_INDEX ) , environment)
11- @echo "Running mutation tests in parallel (Node $(MUTANT_NODE_INDEX)/$(MUTANT_TOTAL_NODES)) for pricing, using .mutant.yml"
12- @find $(MUTANT_TARGET_DIRS) -path ./vendor -prune -o -name '*.rb' -print | sed 's|^\./||' > .all_files.tmp
11+ @echo "Running mutation tests in parallel (Node $$(( $(MUTANT_NODE_INDEX) + 1 ))/$(MUTANT_TOTAL_NODES)) for pricing"
12+ @echo "--- DEBUG: Finding potential subject files ---"
13+ @find $(MUTANT_TARGET_DIRS) -path ./vendor -prune -o -name '*.rb' -print > .all_files.tmp
14+ @echo "--- DEBUG: Found files count: $(shell wc -l < .all_files.tmp)"
15+ @echo "--- END DEBUG ---"
1316 @awk "NR % $(MUTANT_TOTAL_NODES) == $(MUTANT_NODE_INDEX)" .all_files.tmp > .node_files.tmp
14- @SUBJECT_NAMES_CMD="cat .node_files.tmp | perl -pe 's|^lib/||; s|\\.rb$$||; s|/|::|g; s/\\b(\\w)/ucfirst(\$1)/ge'"
15- @SUBJECT_ARGS=$$($$SUBJECT_NAMES_CMD | tr '\\n' ' '); \
17+ @echo "--- DEBUG: Files count for this node ($(MUTANT_NODE_INDEX)): $(shell wc -l < .node_files.tmp)"
18+ @echo "--- END DEBUG ---"
19+ @SUBJECT_NAMES_CMD="cat .node_files.tmp | perl -pe 's|^lib/||; s|\\.rb$$||; s|_([a-z])|uc(\$1)|eg; s|/|::|g; s/(?:^|::)(.)/\\u\$1/g'"
20+ @echo "--- DEBUG: Attempting to derive subject names for this node... ---"
21+ @DERIVED_NAMES=$$(eval $$SUBJECT_NAMES_CMD); \
22+ EXIT_CODE=$$?; \
23+ if [ $$EXIT_CODE -ne 0 ]; then \
24+ echo "Perl command failed with exit code $$EXIT_CODE"; \
25+ exit $$EXIT_CODE; \
26+ elif [ -z "$$DERIVED_NAMES" ]; then \
27+ echo "Perl command produced no output."; \
28+ else \
29+ echo "$$DERIVED_NAMES"; \
30+ fi
31+ @echo "--- END DEBUG ---"
32+ @SUBJECT_ARGS=$$(echo "$$DERIVED_NAMES" | tr '\\n' ' '); \
1633 if [ -z "$$SUBJECT_ARGS" ]; then \
1734 echo "No subjects derived for this node. Skipping."; \
1835 else \
@@ -21,7 +38,7 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
2138 fi
2239 @rm -f .all_files.tmp .node_files.tmp
2340else
24- @echo "Running mutation tests locally (using .mutant.yml)"
41+ @echo "Running mutation tests locally for pricing (using .mutant.yml)"
2542 @RAILS_ENV=test bundle exec mutant run
2643endif
2744
0 commit comments