Skip to content

Commit e3d6bf0

Browse files
committed
Debug mutate parallel execution.
1 parent 5172160 commit e3d6bf0

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

.github/workflows/pricing.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,23 @@ jobs:
5454
bundler-cache: true
5555
working-directory: ${{ env.WORKING_DIRECTORY }}
5656

57-
- run: make mutate
57+
- name: Run mutation tests (Node ${{ matrix.node_index + 1 }} / ${{ matrix.total_nodes }})
58+
run: make mutate
5859
env:
5960
MUTANT_NODE_INDEX: ${{ matrix.node_index }}
6061
MUTANT_TOTAL_NODES: ${{ matrix.total_nodes }}
6162
working-directory: ${{ env.WORKING_DIRECTORY }}
6263

63-
- uses: 8398a7/action-slack@v3
64+
- name: Send Slack Notification on Mutate Status (Node ${{ matrix.node_index + 1 }})
65+
uses: 8398a7/action-slack@v3
6466
with:
6567
status: custom
6668
fields: workflow,job,commit,repo,ref,author,took
6769
custom_payload: |
6870
{
6971
attachments: [{
7072
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
71-
text: `Workflow: ${process.env.AS_WORKFLOW}\nJob: ${process.env.AS_JOB} (Node ${{ matrix.node_index }}/${{ matrix.total_nodes }})\nStatus: ${{ job.status }} in ${process.env.AS_TOOK}\nCommit: ${process.env.AS_COMMIT} on ${process.env.AS_REF} by ${process.env.AS_AUTHOR}`,
73+
text: `Workflow: ${process.env.AS_WORKFLOW}\nJob: ${process.env.AS_JOB} (Node ${{ matrix.node_index + 1 }}/${{ matrix.total_nodes }})\nStatus: ${{ job.status }} in ${process.env.AS_TOOK}\nCommit: ${process.env.AS_COMMIT} on ${process.env.AS_REF} by ${process.env.AS_AUTHOR}`,
7274
}]
7375
}
7476
env:

.github/workflows/rails_application.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,23 @@ jobs:
7979
working-directory: ${{ env.WORKING_DIRECTORY }}
8080
run: bundle exec rails tailwindcss:build
8181

82-
- run: make mutate
82+
- name: Run mutation tests (Node ${{ matrix.node_index + 1 }} / ${{ matrix.total_nodes }})
83+
run: make mutate
8384
env:
8485
MUTANT_NODE_INDEX: ${{ matrix.node_index }}
8586
MUTANT_TOTAL_NODES: ${{ matrix.total_nodes }}
8687
working-directory: ${{ env.WORKING_DIRECTORY }}
8788

88-
- uses: 8398a7/action-slack@v3
89+
- name: Send Slack Notification on Mutate Status (Node ${{ matrix.node_index + 1 }})
90+
uses: 8398a7/action-slack@v3
8991
with:
9092
status: custom
9193
fields: workflow,job,commit,repo,ref,author,took
9294
custom_payload: |
9395
{
9496
attachments: [{
9597
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
96-
text: `Workflow: ${process.env.AS_WORKFLOW}\nJob: ${process.env.AS_JOB} (Node ${{ matrix.node_index }}/${{ matrix.total_nodes }})\nStatus: ${{ job.status }} in ${process.env.AS_TOOK}\nCommit: ${process.env.AS_COMMIT} on ${process.env.AS_REF} by ${process.env.AS_AUTHOR}`,
98+
text: `Workflow: ${process.env.AS_WORKFLOW}\nJob: ${process.env.AS_JOB} (Node ${{ matrix.node_index + 1 }}/${{ matrix.total_nodes }})\nStatus: ${{ job.status }} in ${process.env.AS_TOOK}\nCommit: ${process.env.AS_COMMIT} on ${process.env.AS_REF} by ${process.env.AS_AUTHOR}`,
9799
}]
98100
}
99101
env:

rails_application/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ help:
1717

1818
mutate: ## Run mutation tests
1919
ifeq ($(origin MUTANT_NODE_INDEX), environment)
20-
@echo "Running mutation tests in parallel (Node $(MUTANT_NODE_INDEX)/$(MUTANT_TOTAL_NODES)) for rails_application"
20+
@echo "Running mutation tests in parallel (Node $$(( $(MUTANT_NODE_INDEX) + 1 ))/$(MUTANT_TOTAL_NODES)) for rails_application"
21+
@echo "--- DEBUG: Finding potential subject files ---"
2122
@find $(MUTANT_TARGET_DIRS) -name '*.rb' \
2223
-not -path '*/test/*' \
2324
-not -path '*/spec/*' \
@@ -26,8 +27,17 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
2627
-not -path 'db/*' \
2728
-not -path 'vendor/*' \
2829
-print > .all_files.tmp
30+
@echo "--- DEBUG: Found files (.all_files.tmp): ---"
31+
@cat .all_files.tmp || echo "No files found by find."
32+
@echo "--- END DEBUG ---"
2933
@awk "NR % $(MUTANT_TOTAL_NODES) == $(MUTANT_NODE_INDEX)" .all_files.tmp > .node_files.tmp
34+
@echo "--- DEBUG: Files for this node ($(MUTANT_NODE_INDEX)) (.node_files.tmp): ---"
35+
@cat .node_files.tmp || echo "No files selected for this node by awk."
36+
@echo "--- END DEBUG ---"
3037
@SUBJECT_NAMES_CMD="cat .node_files.tmp | perl -pe 's|^(app|lib)/||; s|\\.rb$$||; s|/|::|g; s/\\b(\\w)/ucfirst(\$1)/ge'"
38+
@echo "--- DEBUG: Derived subject names for this node: ---"
39+
@eval $$SUBJECT_NAMES_CMD || echo "Perl command failed or produced no output."
40+
@echo "--- END DEBUG ---"
3141
@SUBJECT_ARGS=$$($$SUBJECT_NAMES_CMD | tr '\\n' ' '); \
3242
if [ -z "$$SUBJECT_ARGS" ]; then \
3343
echo "No subjects derived for this node. Skipping."; \

0 commit comments

Comments
 (0)