Skip to content

Commit

Permalink
🐛🏗 Actually actually actually fix gracefully halt for abbreviated exp…
Browse files Browse the repository at this point in the history
…eriments (#35385)
  • Loading branch information
danielrozenberg committed Jul 23, 2021
1 parent a5c5b5f commit b1f56e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
27 changes: 12 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ push_builds_only: &push_builds_only
- main
- /^amp-release-.*$/

experiment_job: &experiment_job
parameters:
exp:
description: 'Which of the three (A/B/C) experiments to use'
type: enum
enum: ['A', 'B', 'C']
environment:
EXP: << parameters.exp >>

executors:
amphtml-small-executor:
docker:
Expand Down Expand Up @@ -287,11 +296,7 @@ jobs:
'Experiment Build':
executor:
name: amphtml-xlarge-executor
parameters:
exp:
description: 'Which of the three (A/B/C) experiments to use'
type: enum
enum: ['A', 'B', 'C']
<<: *experiment_job
steps:
- setup_vm
- run:
Expand All @@ -302,11 +307,7 @@ jobs:
'Experiment Integration Tests':
executor:
name: amphtml-large-executor
parameters:
exp:
description: 'Which of the three (A/B/C) experiments to use'
type: enum
enum: ['A', 'B', 'C']
<<: *experiment_job
steps:
- setup_vm
- install_chrome
Expand All @@ -319,11 +320,7 @@ jobs:
'Experiment End-to-End Tests':
executor:
name: amphtml-large-executor
parameters:
exp:
description: 'Which of the three (A/B/C) experiments to use'
type: enum
enum: ['A', 'B', 'C']
<<: *experiment_job
parallelism: 6
steps:
- setup_vm
Expand Down
5 changes: 1 addition & 4 deletions .circleci/maybe_gracefully_halt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ if ls /tmp/restored-workspace/.CI_GRACEFULLY_HALT_* 1>/dev/null 2>&1; then
exit 0
fi

if [[ $CIRCLE_JOB =~ Exp(eriment|\.) ]]; then
# Extract the experiment name from the job name in `config.yml`.
EXP=$(echo $CIRCLE_JOB | awk '{print $2}')

if [[ $EXP ]]; then
# Extract the commit SHA. For PR jobs, this is written to .CIRCLECI_MERGE_COMMIT.
if [[ -f /tmp/restored-workspace/.CIRCLECI_MERGE_COMMIT ]]; then
COMMIT_SHA="$(cat /tmp/restored-workspace/.CIRCLECI_MERGE_COMMIT)"
Expand Down

0 comments on commit b1f56e0

Please sign in to comment.