Skip to content

Commit

Permalink
add a cloud related mode
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Oct 3, 2024
1 parent ee3dff9 commit 1dfc6db
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 22 deletions.
44 changes: 22 additions & 22 deletions build/build/src/ci_gen/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,31 +245,31 @@ impl JobArchetype for StandardLibraryTests {
fn job(&self, target: Target) -> Job {
let graal_edition = self.graal_edition;
let should_enable_cloud_tests = self.cloud_tests_enabled;
// If cloud tests are enabled, we run only cloud related tests.
let test_scope =
if should_enable_cloud_tests { "std-cloud-related" } else { "standard-library" };
let job_name = format!("Standard Library Tests ({graal_edition})");
let run_steps_builder =
RunStepsBuilder::new("backend test standard-library").customize(move |step| {
let main_step = step
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_REGION,
crate::libraries_tests::s3::env::ENSO_LIB_S3_AWS_REGION,
)
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_ACCESS_KEY_ID,
crate::libraries_tests::s3::env::ENSO_LIB_S3_AWS_ACCESS_KEY_ID,
)
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY,
crate::libraries_tests::s3::env::ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY,
);
let run_command = format!("backend test {test_scope}");
let run_steps_builder = RunStepsBuilder::new(run_command).customize(move |step| {
let main_step = step
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_REGION,
crate::libraries_tests::s3::env::ENSO_LIB_S3_AWS_REGION,
)
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_ACCESS_KEY_ID,
crate::libraries_tests::s3::env::ENSO_LIB_S3_AWS_ACCESS_KEY_ID,
)
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY,
crate::libraries_tests::s3::env::ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY,
);

let updated_main_step = if should_enable_cloud_tests {
enable_cloud_tests(main_step)
} else {
main_step
};
let updated_main_step =
if should_enable_cloud_tests { enable_cloud_tests(main_step) } else { main_step };

vec![updated_main_step, step::stdlib_test_reporter(target, graal_edition)]
});
vec![updated_main_step, step::stdlib_test_reporter(target, graal_edition)]
});
let mut job = build_job_ensuring_cloud_tests_run_on_github(
run_steps_builder,
target,
Expand Down
8 changes: 8 additions & 0 deletions build/build/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,18 @@ pub enum Benchmarks {

#[derive(Clone, Copy, Debug, Display, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)]
pub enum Tests {
/// Run the JVM tests.
Jvm,

/// Run all Standard Library tests.
#[clap(alias = "stdlib")]
StandardLibrary,

/// Run the Snowflake tests.
StdSnowflake,

/// Run a subset of Standard Library tests that deals with Cloud-related functionality.
StdCloudRelated,
}

impl Benchmarks {
Expand Down
9 changes: 9 additions & 0 deletions build/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ impl Processor {
"Snowflake_Tests".to_string()
]),
),
Tests::StdCloudRelated => config.add_standard_library_test_selection(
StandardLibraryTestsSelection::Selected(vec![
"Base_Tests".to_string(),
// Table tests check integration of e.g. Postgres datalinks
"Table_Tests".to_string(),
// AWS tests check copying between Cloud and S3
"AWS_Tests".to_string(),
]),
),
}
}
let context = self.prepare_backend_context(config);
Expand Down

0 comments on commit 1dfc6db

Please sign in to comment.