Skip to content

Commit fd8804e

Browse files
radeusgdjdunkerley
authored andcommitted
Workaround missing aws CLI on self-hosted runners by running the Cloud tests on GH runners (#10977)
- Followup of #10964 - I assumed `aws` CLI is available, because it is on GH runners. But we are running on self-hosted by default. - Ideally we should make the CLI available there and switch back. - But for now, trying to run on the GH runner. (cherry picked from commit 88aaa51)
1 parent 14cee45 commit fd8804e

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

.github/workflows/extra-nightly-tests.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ jobs:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545
- run: ./run backend test std-snowflake
4646
env:
47-
ENSO_CLOUD_COGNITO_REGION: ${{ secrets.ENSO_CLOUD_COGNITO_REGION }}
48-
ENSO_CLOUD_COGNITO_USER_POOL_ID: ${{ secrets.ENSO_CLOUD_COGNITO_USER_POOL_ID }}
49-
ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID: ${{ secrets.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }}
50-
ENSO_CLOUD_TEST_ACCOUNT_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }}
51-
ENSO_CLOUD_TEST_ACCOUNT_USERNAME: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
5247
ENSO_SNOWFLAKE_ACCOUNT: ${{ secrets.ENSO_SNOWFLAKE_ACCOUNT }}
5348
ENSO_SNOWFLAKE_DATABASE: ${{ secrets.ENSO_SNOWFLAKE_DATABASE }}
5449
ENSO_SNOWFLAKE_PASSWORD: ${{ secrets.ENSO_SNOWFLAKE_PASSWORD }}
@@ -81,10 +76,9 @@ jobs:
8176
permissions:
8277
checks: write
8378
enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-linux-amd64:
84-
name: Standard Library Tests (GraalVM CE) (linux, amd64)
79+
name: Standard Library Tests (GraalVM CE) (LinuxLatest)
8580
runs-on:
86-
- self-hosted
87-
- Linux
81+
- ubuntu-latest
8882
steps:
8983
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
9084
name: Installing wasm-pack

build/build/src/ci_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ pub fn extra_nightly_tests() -> Result<Workflow> {
707707

708708
// We run the extra tests only on Linux, as they should not contain any platform-specific
709709
// behavior.
710-
let target = (OS::Linux, Arch::X86_64);
710+
let target = PRIMARY_TARGET;
711711
workflow.add(target, job::SnowflakeTests {});
712712
workflow.add(target, job::StandardLibraryTests {
713713
graal_edition: graalvm::Edition::Community,

build/build/src/ci_gen/job.rs

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ impl JobArchetype for StandardLibraryTests {
245245
let graal_edition = self.graal_edition;
246246
let should_enable_cloud_tests = self.cloud_tests_enabled;
247247
let job_name = format!("Standard Library Tests ({graal_edition})");
248-
let mut job = RunStepsBuilder::new("backend test standard-library")
249-
.customize(move |step| {
248+
let run_steps_builder =
249+
RunStepsBuilder::new("backend test standard-library").customize(move |step| {
250250
let main_step = step
251251
.with_secret_exposed_as(
252252
secret::ENSO_LIB_S3_AWS_REGION,
@@ -268,9 +268,14 @@ impl JobArchetype for StandardLibraryTests {
268268
};
269269

270270
vec![updated_main_step, step::stdlib_test_reporter(target, graal_edition)]
271-
})
272-
.build_job(job_name, target)
273-
.with_permission(Permission::Checks, Access::Write);
271+
});
272+
let mut job = build_job_ensuring_cloud_tests_run_on_github(
273+
run_steps_builder,
274+
target,
275+
&job_name,
276+
should_enable_cloud_tests,
277+
)
278+
.with_permission(Permission::Checks, Access::Write);
274279
match graal_edition {
275280
graalvm::Edition::Community => job.env(env::GRAAL_EDITION, graalvm::Edition::Community),
276281
graalvm::Edition::Enterprise =>
@@ -288,6 +293,26 @@ impl JobArchetype for StandardLibraryTests {
288293
}
289294
}
290295

296+
/** This is a temporary workaround.
297+
*
298+
* The Cloud tests preparation requires `aws` CLI to be installed on the machine.
299+
* The GitHub hosted runners have it, but our self-hosted runners do not.
300+
* To fix this we either need to modify self-hosted runners to provide the AWS CLI or change the
301+
* way we prepare the Cloud tests to not require it.
302+
*/
303+
fn build_job_ensuring_cloud_tests_run_on_github(
304+
run_steps_builder: RunStepsBuilder,
305+
target: Target,
306+
job_name: &str,
307+
cloud_tests_enabled: bool,
308+
) -> Job {
309+
if cloud_tests_enabled {
310+
run_steps_builder.build_job(job_name, RunnerLabel::LinuxLatest)
311+
} else {
312+
run_steps_builder.build_job(job_name, target)
313+
}
314+
}
315+
291316
#[derive(Clone, Copy, Debug)]
292317
pub struct SnowflakeTests {}
293318

@@ -324,10 +349,13 @@ impl JobArchetype for SnowflakeTests {
324349
crate::libraries_tests::snowflake::env::ENSO_SNOWFLAKE_WAREHOUSE,
325350
);
326351

327-
let updated_main_step = enable_cloud_tests(main_step);
352+
// Temporarily disabled until we can get the Cloud auth fixed.
353+
// Snowflake does not rely on cloud anyway, so it can be disabled.
354+
// But it will rely once we add datalink tests, so this should be fixed soon.
355+
// let updated_main_step = enable_cloud_tests(main_step);
328356

329357
vec![
330-
updated_main_step,
358+
main_step,
331359
step::extra_stdlib_test_reporter(target, GRAAL_EDITION_FOR_EXTRA_TESTS),
332360
]
333361
})

0 commit comments

Comments
 (0)