Skip to content

Commit aef59f5

Browse files
committed
Try to make mutant use it's ignore rules defined in .mutant.yml.
1 parent 71140d7 commit aef59f5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ecommerce/pricing/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
2929
head -n 5 .node_files.tmp || echo "File .node_files.tmp is empty."; \
3030
echo "--- END DEBUG (awk) ---"; \
3131
echo "--- DEBUG: Attempting to derive subject names for this node... ---"; \
32-
DERIVED_NAMES=$$(cat .node_files.tmp | perl -ne 'chomp; s#^lib/##; s#\.rb$$##; my @parts = split /\//; my $$result = ""; foreach my $$part (@parts) { $$part =~ s#_([a-z])#uc($$1)#eg; $$result .= "::" . ucfirst($$part); } $$result =~ s/^:://; print "$$result\n"'); \
32+
DERIVED_NAMES=$$(cat .node_files.tmp | perl -ne 'next unless /\S/; chomp; s#^lib/##; s#\.rb$$##; my @parts = split /\//; my $$result = ""; foreach my $$part (@parts) { next unless $$part; $$part =~ s#_([a-z])#uc($$1)#eg; $$result .= ucfirst($$part) . "::"; } $$result =~ s/::$$//; print "$$result\n" if $$result && $$result !~ /^::/'); \
3333
PERL_EXIT_CODE=$$?; \
3434
if [ $$PERL_EXIT_CODE -ne 0 ]; then \
3535
echo "ERROR: Perl command failed with exit code $$PERL_EXIT_CODE"; \
@@ -38,15 +38,14 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
3838
elif [ -z "$$DERIVED_NAMES" ]; then \
3939
echo "Perl command produced no output (expected if no files for node)."; \
4040
else \
41-
echo "$$DERIVED_NAMES" | sed 's/^:://'; \
41+
echo "$$DERIVED_NAMES"; \
4242
fi; \
4343
echo "--- END DEBUG (perl) ---"; \
44-
DERIVED_NAMES_FILTERED=$$(echo "$$DERIVED_NAMES" | sed 's/^:://'); \
45-
SUBJECT_ARGS=$$(echo "$$DERIVED_NAMES_FILTERED" | tr '\\n' ' '); \
44+
SUBJECT_ARGS=$$(echo "$$DERIVED_NAMES" | xargs); \
4645
if [ -z "$$SUBJECT_ARGS" ]; then \
4746
echo "No subjects derived for this node. Skipping."; \
4847
else \
49-
echo "Attempting to run mutant for derived subjects: $$SUBJECT_ARGS"; \
48+
echo "Attempting to run mutant for derived subjects (mutant should apply its own ignore rules): $$SUBJECT_ARGS"; \
5049
RAILS_ENV=test bundle exec mutant run $$SUBJECT_ARGS; \
5150
fi; \
5251
rm -f .all_files.tmp .node_files.tmp

rails_application/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
6161
if [ -z "$$SUBJECT_ARGS" ]; then \
6262
echo "No subjects derived for this node. Skipping."; \
6363
else \
64-
echo "Attempting to run mutant for derived subjects: $$SUBJECT_ARGS"; \
64+
echo "Attempting to run mutant for derived subjects (mutant should apply its own ignore rules): $$SUBJECT_ARGS"; \
6565
RAILS_ENV=test bundle exec mutant run $$SUBJECT_ARGS; \
6666
fi; \
6767
rm -f .all_files.tmp .node_files.tmp
6868
else
69-
@echo "Running mutation tests locally for rails_application (mutant discovers subjects)"
69+
# --- Local Execution ---
70+
@echo "Running mutation tests locally for rails_application (mutant discovers subjects from .mutant.yml)"
7071
@RAILS_ENV=test bundle exec mutant run
7172
endif
7273

0 commit comments

Comments
 (0)