Skip to content

Commit

Permalink
Rename BigQuery test credentials key config
Browse files Browse the repository at this point in the history
`bigquery.credentials-key` testing config name clashes with the actual
config name and hence any new bigquery catalogs created through `CREATE
CATALOG` command by running BigQueryQueryRunner may not pick the
different key if provided in command.
  • Loading branch information
mayankvadariya committed Jan 20, 2025
1 parent f548262 commit 8f4bcbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ jobs:
if: matrix.modules == 'plugin/trino-bigquery' && !contains(matrix.profile, 'cloud-tests-2') && (env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || env.BIGQUERY_CREDENTIALS_KEY != '')
run: |
$MAVEN test ${MAVEN_TEST} -pl :trino-bigquery -Pcloud-tests-1 \
-Dbigquery.credentials-key="${BIGQUERY_CREDENTIALS_KEY}" \
-Dtesting.bigquery.credentials-key="${BIGQUERY_CREDENTIALS_KEY}" \
-Dtesting.gcp-storage-bucket="${GCP_STORAGE_BUCKET}" \
-Dtesting.bigquery-connection-id="${BIGQUERY_TESTING_BIGLAKE_CONNECTION_ID}"
- name: Cloud BigQuery Smoke Tests
Expand Down
4 changes: 2 additions & 2 deletions plugin/trino-bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can follow the steps below to be able to run the integration tests locally.

* The `TestBigQueryWithDifferentProjectIdConnectorSmokeTest` requires an alternate project ID which is different from the
project ID attached to the service account but the service account still has access to.
* Set the VM options `bigquery.credentials-key`, `testing.gcp-storage-bucket`, `testing.alternate-bq-project-id`, and `testing.bigquery-connection-id` in the IntelliJ "Run Configuration"
* Set the VM options `testing.bigquery.credentials-key`, `testing.gcp-storage-bucket`, `testing.alternate-bq-project-id`, and `testing.bigquery-connection-id` in the IntelliJ "Run Configuration"
(or on the CLI if using Maven directly). It should look something like
`-Dbigquery.credentials-key=base64-text -Dtesting.gcp-storage-bucket=DESTINATION_BUCKET_NAME -Dtesting.alternate-bq-project-id=bigquery-cicd-alternate -Dtesting.bigquery-connection-id=my_project.us.connection-id`.
`-Dtesting.bigquery.credentials-key=base64-text -Dtesting.gcp-storage-bucket=DESTINATION_BUCKET_NAME -Dtesting.alternate-bq-project-id=bigquery-cicd-alternate -Dtesting.bigquery-connection-id=my_project.us.connection-id`.
* Run any test of your choice.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

public final class BigQueryQueryRunner
{
private static final String BIGQUERY_CREDENTIALS_KEY = requiredNonEmptySystemProperty("bigquery.credentials-key");
private static final String BIGQUERY_CREDENTIALS_KEY = requiredNonEmptySystemProperty("testing.bigquery.credentials-key");
public static final String TPCH_SCHEMA = "tpch";
public static final String TEST_SCHEMA = "test";

Expand Down Expand Up @@ -113,6 +113,7 @@ public DistributedQueryRunner build()

// note: additional copy via ImmutableList so that if fails on nulls
Map<String, String> connectorProperties = new HashMap<>(ImmutableMap.copyOf(this.connectorProperties));
connectorProperties.putIfAbsent("bigquery.credentials-key", BIGQUERY_CREDENTIALS_KEY);
connectorProperties.putIfAbsent("bigquery.views-enabled", "true");
connectorProperties.putIfAbsent("bigquery.view-expire-duration", "30m");
connectorProperties.putIfAbsent("bigquery.rpc-retries", "10");
Expand Down

0 comments on commit 8f4bcbc

Please sign in to comment.