-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ability to launch all integration/standard tests from slash commands #1169
Changes from 23 commits
426c6ea
4413f6e
9c7aaf2
cb8102e
5522fe7
e242da0
585a91f
630c574
5bf3f71
b980923
9fae9c2
cc1a756
923d105
c0862a6
38d51d3
c1e7ca1
d7efcd0
a616a5b
7270e3b
1677ce6
52c7c2b
9e69845
39935fa
e4d9cd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: integration-test | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
connector: | ||
description: 'Airbyte Connector' | ||
required: true | ||
|
||
jobs: | ||
integration_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Search for valid integration name format | ||
id: regex | ||
uses: AsasInnab/regex-action@v1 | ||
with: | ||
regex_pattern: '^[a-zA-Z0-9-_]+$' | ||
regex_flags: 'i' # required to be set for this plugin | ||
search_string: ${{ github.event.inputs.connector }} | ||
- name: Validate input workflow format | ||
if: steps.regex.outputs.first_match != github.event.inputs.connector | ||
run: echo "The connector provided has an invalid format!" && exit 1 | ||
- name: Checkout Airbyte | ||
uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '14' | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.7' | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
- name: Write Integration Test Credentials | ||
run: ./tools/bin/ci_credentials.sh | ||
env: | ||
BIGQUERY_INTEGRATION_TEST_CREDS: ${{ secrets.BIGQUERY_INTEGRATION_TEST_CREDS }} | ||
STRIPE_INTEGRATION_TEST_CREDS: ${{ secrets.STRIPE_INTEGRATION_TEST_CREDS }} | ||
GH_INTEGRATION_TEST_CREDS: ${{ secrets.GH_INTEGRATION_TEST_CREDS }} | ||
SALESFORCE_INTEGRATION_TESTS_CREDS: ${{ secrets.SALESFORCE_INTEGRATION_TESTS_CREDS }} | ||
GOOGLE_ANALYTICS_TEST_CREDS: ${{ secrets.GOOGLE_ANALYTICS_TEST_CREDS }} | ||
GOOGLE_ANALYTICS_TEST_TRACKING_ID: ${{ secrets.GOOGLE_ANALYTICS_TEST_TRACKING_ID }} | ||
HUBSPOT_INTEGRATION_TESTS_CREDS: ${{ secrets.HUBSPOT_INTEGRATION_TESTS_CREDS }} | ||
GSHEETS_INTEGRATION_TESTS_CREDS: ${{ secrets.GSHEETS_INTEGRATION_TESTS_CREDS }} | ||
SNOWFLAKE_INTEGRATION_TEST_CREDS: ${{ secrets.SNOWFLAKE_INTEGRATION_TEST_CREDS }} | ||
ADWORDS_INTEGRATION_TEST_CREDS: ${{ secrets.ADWORDS_INTEGRATION_TEST_CREDS }} | ||
FACEBOOK_MARKETING_API_TEST_INTEGRATION_CREDS: ${{ secrets.FACEBOOK_MARKETING_API_TEST_INTEGRATION_CREDS }} | ||
SOURCE_MARKETO_SINGER_INTEGRATION_TEST_CONFIG: ${{ secrets.SOURCE_MARKETO_SINGER_INTEGRATION_TEST_CONFIG }} | ||
SHOPIFY_INTEGRATION_TEST_CREDS: ${{ secrets.SHOPIFY_INTEGRATION_TEST_CREDS }} | ||
AWS_S3_INTEGRATION_TEST_CREDS: ${{ secrets.AWS_S3_INTEGRATION_TEST_CREDS }} | ||
AWS_REDSHIFT_INTEGRATION_TEST_CREDS: ${{ secrets.AWS_REDSHIFT_INTEGRATION_TEST_CREDS }} | ||
MAILCHIMP_TEST_CREDS: ${{ secrets.MAILCHIMP_TEST_CREDS }} | ||
- run: | | ||
./tools/bin/ci_integration_test.sh ${{ github.event.inputs.connector }} |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,32 @@ | ||||
#!/usr/bin/env bash | ||||
|
||||
set -e | ||||
|
||||
# runs integration and/or standard tests for an integration name | ||||
|
||||
connector="$1" | ||||
all_integration_tests=$(./gradlew integrationTest --dry-run | grep 'integrationTest SKIPPED' | cut -d: -f 4) | ||||
all_standard_python_tests=$(./gradlew standardSourceTestPython --dry-run | grep 'standardSourceTestPython SKIPPED' | cut -d: -f 4) | ||||
|
||||
if [[ "$connector" == "all" ]] ; then | ||||
echo "Running: ./gradlew --no-daemon --scan integrationTest standardSourceTestPython" | ||||
./gradlew --no-daemon --scan integrationTest standardSourceTestPython | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
else | ||||
selected_integration_test=$(echo "$all_integration_tests" | grep "^$connector$" || echo "") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not blocking for this PR, but should this selection logic live in a gradle task where we just say "integrationTest" and it figures out whether it's standard python or anything else? That way it can be re-used by any other tools, and is more accessible for anyone new to the repo since it's all wrapped in a gradle task There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. It feels like |
||||
selected_standard_python_test=$(echo "$all_standard_python_tests" | grep "^$connector$" || echo "") | ||||
integrationTestCommand=":airbyte-integrations:connectors:$connector:integrationTest" | ||||
standardPythonTestCommand=":airbyte-integrations:connectors:$connector:standardSourceTestPython" | ||||
if [ -n "$selected_integration_test" ] && [ -n "$selected_standard_python_test" ] ; then | ||||
echo "Running: ./gradlew --no-daemon --scan $integrationTestCommand $standardPythonTestCommand" | ||||
./gradlew --no-daemon --scan "$integrationTestCommand" "$standardPythonTestCommand" | ||||
elif [ -z "$selected_integration_test" ] && [ -n "$selected_standard_python_test" ] ; then | ||||
echo "Running: ./gradlew --no-daemon --scan $standardPythonTestCommand" | ||||
./gradlew --no-daemon --scan "$standardPythonTestCommand" | ||||
elif [ -n "$selected_integration_test" ] && [ -z "$selected_standard_python_test" ] ; then | ||||
echo "Running: ./gradlew --no-daemon --scan $integrationTestCommand" | ||||
./gradlew --no-daemon --scan "$integrationTestCommand" | ||||
else | ||||
echo "Connector '$connector' not found..." | ||||
exit 1 | ||||
fi | ||||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# launches integration test workflows for master builds | ||
|
||
# todo: check if existing things already run for these on master | ||
# todo: report status of jobs somewhere | ||
|
||
if [[ -z "$GITHUB_TOKEN" ]] ; then | ||
echo "GITHUB_TOKEN not set..." | ||
exit 1 | ||
fi | ||
|
||
echo "TODO..." |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just
$cmd
doesn't work, and we'd need to add evals.Since this is temporary anyways, going to just merge as is and improve later.