Snowflake JDBC v1.1.5 #366
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Connector E2E Tests (staging) | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, labeled] | |
branches: [main] | |
paths: | |
- registry/** | |
jobs: | |
setup-e2e: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.e2e-test-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch_depth: 1 | |
- name: Get all connector version package changes | |
id: connector-version-changed-files | |
uses: tj-actions/[email protected] | |
with: | |
json: true | |
escape_json: false | |
files: | | |
registry/** | |
- name: Print out all the changed files | |
env: | |
ADDED_FILES: ${{ steps.connector-version-changed-files.outputs.added_files }} | |
MODIFIED_FILES: ${{ steps.connector-version-changed-files.outputs.modified_files }} | |
DELETED_FILES: ${{ steps.connector-version-changed-files.outputs.deleted_files }} | |
run: | | |
echo "{\"added_files\": $ADDED_FILES, \"modified_files\": $MODIFIED_FILES, \"deleted_files\": $DELETED_FILES}" > changed_files.json | |
- name: List changed files | |
id: list_files | |
run: | | |
cat changed_files.json | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
- name: Get the list of e2e tests to run | |
id: e2e-test-matrix | |
env: | |
CHANGED_FILES_PATH: "changed_files.json" | |
run: | | |
mv changed_files.json registry-automation/changed_files.json | |
export NDC_HUB_GIT_REPO_FILE_PATH=$(pwd) | |
cd registry-automation | |
MATRIX_JSON=$(go run main.go e2e changed) | |
echo "$MATRIX_JSON" | |
echo "matrix=$MATRIX_JSON" >> "$GITHUB_OUTPUT" | |
- name: Check if connector is published to staging | |
id: check-connector-publish-status | |
run: | | |
LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}' | |
REQUIRED_LABEL="connector-staging-deploy-success" | |
if echo "$LABELS" | jq -e 'contains(["'"$REQUIRED_LABEL"'"])' > /dev/null; then | |
echo "Connector published to staging!" | |
else | |
echo "Error: Connector is not yet published to staging. This Job will automatically run again once the connector is published to staging." | |
exit 1 | |
fi | |
e2e-tests: | |
needs: setup-e2e | |
runs-on: ubuntu-latest | |
environment: staging | |
strategy: | |
fail-fast: false | |
matrix: | |
task: ${{ fromJSON(needs.setup-e2e.outputs.matrix) }} | |
env: | |
CLI_TAG: latest-staging | |
SECRETS_JSON: ${{ toJson(secrets) }} | |
steps: | |
- name: test | |
run: | | |
echo "Running e2e tests for ${{ toJSON(matrix.task) }}" | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch_depth: 1 | |
- name: Set matching env vars | |
run: | | |
echo "$SECRETS_JSON" | jq -r 'to_entries[] | select(.key | endswith("_CONFIG_OPTIONS_ENV")) | "\(.key)=\(.value)"' | while IFS= read -r line; do | |
echo "$line" >> "$GITHUB_ENV" | |
export "$line" | |
done | |
- name: Set custom connector env vars | |
run: | | |
# Extract BigQuery key JSON from secrets if it exists | |
if echo "$SECRETS_JSON" | jq -e 'has("BIGQUERY_KEY_JSON")' > /dev/null; then | |
# Extract the key and save it to an environment variable | |
BIGQUERY_KEY_JSON=$(echo "$SECRETS_JSON" | jq -r '.BIGQUERY_KEY_JSON') | |
echo "BIGQUERY_KEY_JSON<<EOF" >> $GITHUB_ENV | |
echo "$BIGQUERY_KEY_JSON" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
echo "Successfully set BIGQUERY_KEY_JSON environment variable" | |
else | |
echo "Warning: BIGQUERY_KEY_JSON not found in secrets" | |
fi | |
- name: Install bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: 1.2.4 | |
- name: Run e2e tests | |
working-directory: ./ | |
env: | |
HASURA_DDN_PAT: ${{ secrets.HASURA_DDN_PAT }} | |
CLI_TAG: latest-staging | |
run: | | |
export NDC_HUB_GIT_REPO_FILE_PATH=$(pwd) | |
cd registry-automation/e2e-testing | |
JOB_JSON='${{ toJSON(matrix.task) }}' | |
echo "$JOB_JSON" | |
echo "$JOB_JSON" | jq -c '[.]' > test-job.json | |
cat test-job.json | |
bun install | |
export TEST_JOB_FILE=test-job.json | |
bun run start-ndc |