Skip to content

Commit

Permalink
Clean up credentials file after E2E job. (#11285)
Browse files Browse the repository at this point in the history
- While #11255 fixes the root cause of #11278, this PR fixes what triggered it - since #11198 our runners were keeping `~/.enso/credentials` file between runs, meaning that some tests were unexpectedly running in 'authenticated' mode. This PR cleans up this file to avoid that.
  • Loading branch information
radeusgd authored Oct 9, 2024
1 parent 7f5c0e6 commit 669ac97
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ jobs:
ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
ENSO_TEST_USER_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: rm $HOME/.enso/credentials
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: failure() && runner.os == 'Windows'
name: List files if failed (Windows)
run: Get-ChildItem -Force -Recurse
Expand Down Expand Up @@ -441,6 +444,9 @@ jobs:
ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
ENSO_TEST_USER_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: rm $HOME/.enso/credentials
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: failure() && runner.os == 'Windows'
name: List files if failed (Windows)
run: Get-ChildItem -Force -Recurse
Expand Down Expand Up @@ -506,6 +512,9 @@ jobs:
ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
ENSO_TEST_USER_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: rm $HOME/.enso/credentials
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: failure() && runner.os == 'Windows'
name: List files if failed (Windows)
run: Get-ChildItem -Force -Recurse
Expand Down
10 changes: 10 additions & 0 deletions build/build/src/ci_gen/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,16 @@ impl JobArchetype for PackageIde {
"ENSO_TEST_USER_PASSWORD",
);
steps.push(test_step);

// After the E2E tests run, they create a credentials file in user home directory.
// If that file is not cleaned up, future runs of our tests may randomly get
// authenticated into Enso Cloud. We want to run tests as an authenticated
// user only when we explicitly set that up, not randomly. So we clean the credentials
// file.
let cloud_credentials_path = "$HOME/.enso/credentials";
let cleanup_credentials_step = shell(format!("rm {cloud_credentials_path}"));
steps.push(cleanup_credentials_step);

steps
})
.build_job("Package New IDE", target)
Expand Down

0 comments on commit 669ac97

Please sign in to comment.