Skip to content

Commit b7c115f

Browse files
authored
Merge pull request #448 from RailsEventStore/mutant-parallel-execution-tuning
Mutant parallel execution tuning
2 parents d6c2f9d + 8fc441f commit b7c115f

File tree

2 files changed

+45
-20
lines changed

2 files changed

+45
-20
lines changed

.github/workflows/pricing.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,33 @@ jobs:
112112
working-directory: ${{ env.WORKING_DIRECTORY }}
113113
env:
114114
CI_MUTATE_SUBJECTS: ${{ matrix.subject_group }}
115-
- name: Set Shard Display Index
116-
run: echo "SHARD_DISPLAY_INDEX=$(( ${{ strategy['job-index'] }} + 1 ))" >> $GITHUB_ENV
117-
- uses: 8398a7/action-slack@v3
115+
116+
notify_pricing_mutation_summary:
117+
runs-on: ubuntu-24.04
118+
needs: [mutate, prepare_mutation_subjects_pricing]
119+
if: always() && needs.prepare_mutation_subjects_pricing.outputs.subject_groups != '[]' && needs.prepare_mutation_subjects_pricing.outputs.subject_groups != ''
120+
steps:
121+
- name: Determine notification color
122+
id: set_color
123+
run: |
124+
if [[ "${{ needs.mutate.result }}" == "success" ]]; then
125+
echo "NOTIFICATION_COLOR=good" >> $GITHUB_ENV
126+
elif [[ "${{ needs.mutate.result }}" == "failure" ]]; then
127+
echo "NOTIFICATION_COLOR=danger" >> $GITHUB_ENV
128+
else
129+
echo "NOTIFICATION_COLOR=warning" >> $GITHUB_ENV
130+
fi
131+
- name: Send mutation summary notification
132+
uses: 8398a7/action-slack@v3
118133
with:
119134
status: custom
120135
fields: workflow,commit,repo,ref,author
121136
custom_payload: |
122137
{
123-
attachments: [{
124-
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
125-
text: `${process.env.AS_WORKFLOW}/${{ github.job }} (shard ${{ env.SHARD_DISPLAY_INDEX }}/${{ strategy.job-total }}) ${{ job.status }}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`,
138+
"attachments": [{
139+
"color": "${{ env.NOTIFICATION_COLOR }}",
140+
"text": "pricing Mutation Test Summary:\nStatus: ${{ needs.mutate.result }}\nWorkflow: ${{ github.workflow }}\nCommit: ${{ github.sha }} in ${{ github.ref }}"
126141
}]
127142
}
128143
env:
129144
SLACK_WEBHOOK_URL: ${{ secrets.CI_WEBHOOK }}
130-
if: always()
131-
continue-on-error: true

.github/workflows/rails_application.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434
- uses: 8398a7/action-slack@v3
3535
with:
3636
status: custom
37-
fields: workflow,job,commit,repo,ref,author,took
37+
fields: workflow,commit,repo,ref,author
3838
custom_payload: |
3939
{
4040
attachments: [{
4141
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
42-
text: `${process.env.AS_WORKFLOW}/${{ github.job }} ${{ job.status }} in ${process.env.AS_TOOK}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`,
42+
text: `${process.env.AS_WORKFLOW}/${{ github.job }} ${{ job.status }}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`
4343
}]
4444
}
4545
env:
@@ -73,7 +73,6 @@ jobs:
7373
id: split_subjects
7474
working-directory: ${{ env.WORKING_DIRECTORY }}
7575
run: |
76-
# Ensure database is ready before listing subjects
7776
echo "Waiting for PostgreSQL to be ready..."
7877
until pg_isready -h localhost -p 5432 -U "postgres" -d "cqrs-es-sample-with-res_test"; do
7978
sleep 1
@@ -101,7 +100,7 @@ jobs:
101100
fi
102101
103102
total_subjects=${#subjects_array[@]}
104-
NUM_GROUPS=24 # Define the number of parallel jobs
103+
NUM_GROUPS=32 # Define the number of parallel jobs
105104
groups_json_array_content=""
106105
107106
for (( i=0; i<NUM_GROUPS; i++ )); do
@@ -156,23 +155,36 @@ jobs:
156155
working-directory: ${{ env.WORKING_DIRECTORY }}
157156
env:
158157
CI_MUTATE_SUBJECTS: ${{ matrix.subject_group }}
159-
- name: Set Shard Display Index
160-
run: echo "SHARD_DISPLAY_INDEX=$(( ${{ strategy['job-index'] }} + 1 ))" >> $GITHUB_ENV
161-
- uses: 8398a7/action-slack@v3
158+
159+
notify_rails_mutation_summary:
160+
runs-on: ubuntu-24.04
161+
needs: [mutate, prepare_mutation_subjects_rails]
162+
if: always() && needs.prepare_mutation_subjects_rails.outputs.subject_groups != '[]' && needs.prepare_mutation_subjects_rails.outputs.subject_groups != ''
163+
steps:
164+
- name: Determine notification color
165+
id: set_color
166+
run: |
167+
if [[ "${{ needs.mutate.result }}" == "success" ]]; then
168+
echo "NOTIFICATION_COLOR=good" >> $GITHUB_ENV
169+
elif [[ "${{ needs.mutate.result }}" == "failure" ]]; then
170+
echo "NOTIFICATION_COLOR=danger" >> $GITHUB_ENV
171+
else
172+
echo "NOTIFICATION_COLOR=warning" >> $GITHUB_ENV
173+
fi
174+
- name: Send mutation summary notification
175+
uses: 8398a7/action-slack@v3
162176
with:
163177
status: custom
164178
fields: workflow,commit,repo,ref,author
165179
custom_payload: |
166180
{
167-
attachments: [{
168-
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
169-
text: `${process.env.AS_WORKFLOW}/${{ github.job }} (shard ${{ env.SHARD_DISPLAY_INDEX }}/${{ strategy.job-total }}) ${{ job.status }}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`,
181+
"attachments": [{
182+
"color": "${{ env.NOTIFICATION_COLOR }}",
183+
"text": "rails_application Mutation Test Summary:\nStatus: ${{ needs.mutate.result }}\nWorkflow: ${{ github.workflow }}\nCommit: ${{ github.sha }} in ${{ github.ref }}"
170184
}]
171185
}
172186
env:
173187
SLACK_WEBHOOK_URL: ${{ secrets.CI_WEBHOOK }}
174-
if: always()
175-
continue-on-error: true
176188

177189
release:
178190
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)