Skip to content

Commit 34da433

Browse files
authored
CLOUDP-337035 Failed to update test snapshots (#4114)
1 parent eb966e0 commit 34da433

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

.github/workflows/update-e2e-tests.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ jobs:
8686
skip_update_check = true
8787
8888
[__e2e]
89-
org_id = '${{ secrets.MONGODB_ATLAS_ORG_ID }}'
90-
project_id = '${{ secrets.MONGODB_ATLAS_PROJECT_ID }}'
91-
public_api_key = '${{ secrets.MONGODB_ATLAS_PROJECT_ID }}'
92-
private_api_key = '${{ secrets.MONGODB_ATLAS_PRIVATE_API_KEY }}'
93-
ops_manager_url = '${{ secrets.MONGODB_ATLAS_OPS_MANAGER_URL }}'
89+
org_id = 'a0123456789abcdef012345a'
90+
project_id = 'b0123456789abcdef012345b'
91+
public_api_key = 'ABCDEF01'
92+
private_api_key = '12345678-abcd-ef01-2345-6789abcdef01'
93+
ops_manager_url = 'http://localhost:8080/'
9494
service = 'cloud'
9595
telemetry_enabled = false
9696
output = 'plaintext'
@@ -104,9 +104,18 @@ jobs:
104104
service = 'cloud'
105105
telemetry_enabled = false
106106
output = 'plaintext'
107-
EOF
107+
MONGODB_ATLAS_ORG_ID: ${{ secrets.MONGODB_ATLAS_ORG_ID }}
108+
MONGODB_ATLAS_PROJECT_ID: ${{ secrets.MONGODB_ATLAS_PROJECT_ID }}
109+
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_API_KEY }}
110+
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_API_KEY }}
111+
MONGODB_ATLAS_OPS_MANAGER_URL: ${{ secrets.MONGODB_ATLAS_OPS_MANAGER_URL }}
108112
run: |
109113
echo "$CONFIG_CONTENT" > "$CONFIG_PATH"
114+
./bin/atlas config set org_id "$MONGODB_ATLAS_ORG_ID" -P __e2e
115+
./bin/atlas config set project_id "$MONGODB_ATLAS_PROJECT_ID" -P __e2e
116+
./bin/atlas config set public_api_key "$MONGODB_ATLAS_PUBLIC_API_KEY" -P __e2e
117+
./bin/atlas config set private_api_key "$MONGODB_ATLAS_PRIVATE_API_KEY" -P __e2e
118+
./bin/atlas config set ops_manager_url "$MONGODB_ATLAS_OPS_MANAGER_URL" -P __e2e
110119
- run: make e2e-test
111120
env:
112121
TEST_CMD: gotestsum --junitfile e2e-tests.xml --format standard-verbose --
@@ -211,7 +220,7 @@ jobs:
211220
paths: e2e-tests.xml
212221
commit:
213222
runs-on: ubuntu-latest
214-
if: always() && github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'update-snapshots'
223+
if: success() && github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'update-snapshots'
215224
needs: update-tests
216225
steps:
217226
- name: set Apix Bot token
@@ -243,6 +252,25 @@ jobs:
243252
with:
244253
github_token: ${{ steps.app-token.outputs.token }}
245254
labels: update-snapshots
255+
comment:
256+
runs-on: ubuntu-latest
257+
if: failure() && github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'update-snapshots'
258+
needs: update-tests
259+
steps:
260+
- name: set Apix Bot token
261+
id: app-token
262+
uses: mongodb/apix-action/token@6c3fde402c21942fa46cde003f190c2b23c59530
263+
with:
264+
app-id: ${{ secrets.APIXBOT_APP_ID }}
265+
private-key: ${{ secrets.APIXBOT_APP_PEM }}
266+
- uses: actions-ecosystem/action-remove-labels@v1
267+
with:
268+
github_token: ${{ steps.app-token.outputs.token }}
269+
labels: update-snapshots
270+
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405
271+
with:
272+
header: test
273+
message: "Failed to update test snapshots."
246274
pr:
247275
runs-on: ubuntu-latest
248276
if: success() && github.event_name != 'pull_request'

0 commit comments

Comments
 (0)