From 5d4495604a23d5eca533aa8489d30704cdf27c05 Mon Sep 17 00:00:00 2001 From: Michel Davit Date: Tue, 20 Feb 2024 10:49:49 +0100 Subject: [PATCH] Fix populate it data (#5260) --- .github/workflows/populate-it-data.yml | 6 +++--- build.sbt | 1 + project/JavaOptions.scala | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/populate-it-data.yml b/.github/workflows/populate-it-data.yml index 0238c7c574..7d30c848e4 100644 --- a/.github/workflows/populate-it-data.yml +++ b/.github/workflows/populate-it-data.yml @@ -37,10 +37,10 @@ jobs: CLOUDSQL_SQLSERVER_PASSWORD: ${{ secrets.CLOUDSQL_SQLSERVER_PASSWORD }} - name: Populate GCS test data - run: sbt integration/runMain com.spotify.scio.PopulateTestData + run: sbt "integration/runMain com.spotify.scio.PopulateTestData" - name: Populate BQ test data - run: sbt integration/runMain com.spotify.scio.bigquery.PopulateTestData + run: sbt "integration/runMain com.spotify.scio.bigquery.PopulateTestData" - name: Populate SQL test data - run: sbt integration/runMain com.spotify.scio.jdbc.PopulateTestData + run: sbt "integration/runMain com.spotify.scio.jdbc.PopulateTestData" diff --git a/build.sbt b/build.sbt index 1ec2ec6678..5740889266 100644 --- a/build.sbt +++ b/build.sbt @@ -435,6 +435,7 @@ val commonSettings = Def.settings( resolvers ++= Resolver.sonatypeOssRepos("public"), fork := true, run / outputStrategy := Some(OutputStrategy.StdoutOutput), + run / javaOptions ++= JavaOptions.runDefaults(javaMajorVersion), Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat, Test / javaOptions ++= JavaOptions.testDefaults(javaMajorVersion), Test / testOptions += Tests.Argument("-oD"), diff --git a/project/JavaOptions.scala b/project/JavaOptions.scala index 7cbf465d2a..3a4798c086 100644 --- a/project/JavaOptions.scala +++ b/project/JavaOptions.scala @@ -86,4 +86,20 @@ object JavaOptions { "cloudsql.sqlserver.password" ).flatMap(prop => sys.props.get(prop).map(value => property(prop, value))) ) + + def runDefaults(javaVersion: Int): Seq[String] = + tokensForVersion( + javaVersion, + Set( + minHeapSize("512m"), + maxHeapSize("2G"), + advanced("+UseParallelGC"), + property("scio.ignoreVersionWarning", "true"), + property("org.slf4j.simpleLogger.defaultLogLevel", "info") + ) ++ Set( + "bigquery.project", + "bigquery.secret", + "cloudsql.sqlserver.password" + ).flatMap(prop => sys.props.get(prop).map(value => property(prop, value))) + ) }