Skip to content

Commit

Permalink
Merge branch 'main' into DAT-16713
Browse files Browse the repository at this point in the history
  • Loading branch information
jandroav authored Jun 3, 2024
2 parents 61fde9a + e9c9ba7 commit 84b5345
Show file tree
Hide file tree
Showing 137 changed files with 384 additions and 1,725 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/OracleRunParallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
cache: 'maven'

- name: Docker login to retrive Oracle images from private repo
run: docker login "${{ secrets.ARTIFACTORY_URL }}" -u "${{ secrets.ARTIFACTORY_USER }}" -p "${{ secrets.ARTIFACTORY_TOKEN }}"
run: docker login "${{ secrets.REPO_URL }}" -u "${{ secrets.REPO_USER }}" -p "${{ secrets.REPO_PASSWORD }}"

- name: Build Oracle Artifactory test infra
if: ${{ matrix.plan == '19.3.0' }}
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: Advanced Test Execution
on:
schedule:
- cron: '0 6 * * *' # Execute every day at noon
- cron: '0 6 * * *' # Execute every day at 6AM UTC
workflow_dispatch:
inputs:
runDescription:
Expand All @@ -25,8 +25,7 @@ on:
databases:
description: Databases to start up. Comma separated list of "name"
required: true
default: "[\"mysql-5.6\",\"mysql-5.7\",\"mysql-8\",\"postgres-9.5\",\"postgres-9\",\"postgres-10\",
\"postgres-11\",\"postgres-12\",\"postgres-13\",\"postgres-14\",\"postgres-15\",\"postgres-16\",\"mariadb-10.2\",\"mariadb-10.3\",\"mariadb-10.4\",\"mariadb-10.5\",\"mariadb-10.6\",
default: "[\"mysql-5.6\",\"mysql-5.7\",\"mysql-8\",\"postgres-12\",\"postgres-13\",\"postgres-14\",\"postgres-15\",\"postgres-16\",\"mariadb-10.2\",\"mariadb-10.3\",\"mariadb-10.4\",\"mariadb-10.5\",\"mariadb-10.6\",
\"mariadb-10.7\",\"mssql-2017\",\"mssql-2019\",\"mssql-2022\",\"crdb-20.2\",\"crdb-21.1\",\"crdb-21.2\",\"crdb-22.1\",\"percona-xtradb-cluster-5.7\",\"percona-xtradb-cluster-8.0\",
\"edb-edb-9.5\",\"edb-edb-9.6\",\"edb-edb-10\",\"edb-edb-11\",\"edb-edb-12\",\"edb-edb-13\",\"edb-edb-14\",\"db2-luw\",\"H2Database-2.2\",\"sqlite\",\"derby\",
\"firebird-3\",\"firebird-4\",\"hsqldb-2.4\",\"hsqldb-2.5\",\"diff\"]"
Expand All @@ -50,8 +49,8 @@ jobs:
useLiquibaseSnapshot: ${{ steps.configure-build.outputs.useLiquibaseSnapshot }}
liquibaseBranch: ${{ steps.configure-build.outputs.liquibaseBranch }}
liquibaseRepo: ${{ steps.configure-build.outputs.liquibaseRepo }}
databases: ${{ github.event.inputs.databases || '["mysql-5.6","mysql-5.7","mysql-8","postgres-9.5",
"postgres-9","postgres-10","postgres-11","postgres-12","postgres-13","postgres-14","postgres-15","postgres-16","mariadb-10.2","mariadb-10.3","mariadb-10.4","mariadb-10.5","mariadb-10.6",
databases: ${{ github.event.inputs.databases || '["mysql-5.6","mysql-5.7","mysql-8",
"postgres-12","postgres-13","postgres-14","postgres-15","postgres-16","mariadb-10.2","mariadb-10.3","mariadb-10.4","mariadb-10.5","mariadb-10.6",
"mariadb-10.7","mssql-2017","mssql-2019","mssql-2022","crdb-20.2","crdb-21.1","crdb-21.2","crdb-22.1","percona-xtradb-cluster-5.7","percona-xtradb-cluster-8.0",
"edb-edb-9.5","edb-edb-9.6","edb-edb-10","edb-edb-11","edb-edb-12","edb-edb-13","edb-edb-14","db2-luw","H2Database-2.2","sqlite","derby","firebird-3","firebird-4",
"hsqldb-2.4","hsqldb-2.5","diff"]' }}
Expand Down Expand Up @@ -207,9 +206,9 @@ jobs:
working-directory: src/test/resources/docker
run: ./create-infra.sh ${{ matrix.database }}
env:
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
REPO_URL: ${{ secrets.REPO_URL }}
REPO_USER: ${{ secrets.REPO_USER }}
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}

- name: Configure Liquibase Version
if: needs.setup.outputs.useLiquibaseSnapshot == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/attach-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ on:

jobs:
attach-artifact-to-release:
uses: liquibase/build-logic/.github/workflows/[email protected].0
uses: liquibase/build-logic/.github/workflows/[email protected].7
secrets: inherit
291 changes: 291 additions & 0 deletions .github/workflows/aws-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
# Terraform Action to test Cloud Databases with test-harness

name: AWS Weekly Cloud Database Test Execution
concurrency: aws-run
on:
# Triggers the workflow on a schedule for the main branch. Also allows for manual triggers
# Execute every sunday at 6:00 AM
schedule:
- cron: '0 6 * * 0'
workflow_dispatch:
inputs:
testClasses:
type: choice
description: Test Suite or test class to run
options:
- LiquibaseHarnessSuiteTest
- FoundationalHarnessSuiteTest
- AdvancedHarnessSuiteTest
- ChangeObjectTests
- ChangeDataTests
- SnapshotObjectTests
- GenerateChangelogTest
- FoundationalTest
databases:
description: Databases to start up. Comma separated list of "name:version"
required: true
default: "[\"postgresql:12\",\"postgresql:13\",\"postgresql:14\",\"oracle:aws_19\",\"mariadb:aws_10.6\",\"mysql:aws\",\"mysql:aurora\",\"mssql:2019\",\"postgresql:aurora\"]"

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
databases: ${{ github.event.inputs.databases || '["postgresql:12","postgresql:13","postgresql:14","oracle:aws_19","mariadb:aws_10.6","mysql:aws","mysql:aurora","mssql:2019","postgresql:aurora"]' }}
testClasses: ${{ inputs.testClasses || 'LiquibaseHarnessSuiteTest' }}
steps:
- name: Checkout
uses: actions/checkout@v4

deploy-ephemeral-cloud-infra:
uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@DAT-17834
secrets: inherit
with:
deploy: true
aws_test_harness: true

init-mysql:
runs-on: ubuntu-latest
needs: [deploy-ephemeral-cloud-infra]
container:
image: liquibase/liquibase:latest
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
strategy:
fail-fast: false
matrix:
include:
- database: mysql
version: aws
- database: mysql
version: aurora
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_DEV_GITHUB_OIDC_ROLE_ARN_BUILD_LOGIC }}
aws-region: us-east-1

- name: Get AWS secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_MYSQLURL_8_0, /testautomation/db_details/aws_mysql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_AURORA_MYSQLURL, /testautomation/db_details/aurora_mysql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_ORACLEURL_19, /testautomation/db_details/aws_oracle_19_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_12, /testautomation/db_details/aws_postgresql_12_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_13, /testautomation/db_details/aws_postgresql_13_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_14, /testautomation/db_details/aws_postgresql_14_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_MARIADBURL_10_6, /testautomation/db_details/aws_mariadb_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_MSSQLURL, /testautomation/db_details/aws_mssql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_AURORA_POSTGRESQLURL, /testautomation/db_details/aurora_postgresql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
#This additional init step is required because of mysql driver issue on GH actions
- name: Install Dependencies
run: lpm update && lpm add mysql

- name: Clean AWS MySQL Database
uses: liquibase-github-actions/[email protected]
if: ${{ matrix.version == 'aws' }}
with:
url: "${{ env.TH_MYSQLURL_8_0 }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- name: Init Database
if: ${{ matrix.version == 'aws' }}
run: liquibase --classpath="src/test/resources/init-changelogs/aws" --changeLogFile="${{ matrix.database }}.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ env.TH_MYSQLURL_8_0 }}" update

- name: Clean Aurora MySQL Database
uses: liquibase-github-actions/[email protected]
if: ${{ matrix.version == 'aurora' }}
with:
url: "${{ env.TH_AURORA_MYSQLURL }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- name: Init Database
if: ${{ matrix.version == 'aurora' }}
run: liquibase --classpath="src/test/resources/init-changelogs/aws" --changeLogFile="${{ matrix.database }}.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ env.TH_AURORA_MYSQLURL }}" update

test:
needs: [init-mysql, setup]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database: ${{ fromJson(needs.setup.outputs.databases) }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Test
id: setup
uses: actions/[email protected]
with:
script: |
let splitValues = "${{ matrix.database }}".split(":")
core.setOutput("databasePlatform", splitValues[0]);
core.setOutput("databaseVersion", splitValues[1]);
- uses: liquibase-github-actions/[email protected]
if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }}
with:
url: "${{ env.TH_ORACLEURL_19 }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }}
with:
operation: "update"
classpath: "src/test/resources/init-changelogs/aws"
changeLogFile: "oracle.sql"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_ORACLEURL_19 }}"

- uses: liquibase-github-actions/[email protected]
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }}
with:
url: "${{ env[format('TH_PGRESURL_{0}', steps.setup.outputs.databaseVersion)] }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }}
with:
operation: "update"
classpath: "src/test/resources/init-changelogs/aws"
changeLogFile: "postgresql.sql"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env[format('TH_PGRESURL_{0}', steps.setup.outputs.databaseVersion)] }}"

- uses: liquibase-github-actions/[email protected]
if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }}
with:
url: "${{ env.TH_MARIADBURL_10_6 }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }}
with:
operation: "update"
classpath: "src/test/resources/init-changelogs/aws"
changeLogFile: "mariadb.sql"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_MARIADBURL_10_6 }}"

- uses: liquibase-github-actions/[email protected]
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
with:
url: "${{ env.TH_MSSQLURL }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
with:
operation: "update"
classpath: "src/test/resources/init-changelogs/aws"
changeLogFile: "mssql.sql"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_MSSQLURL }}"

- uses: liquibase-github-actions/[email protected]
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }}
with:
url: "${{ env.TH_AURORA_POSTGRESQLURL }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }}
with:
operation: "update"
classpath: "src/test/resources/init-changelogs/aws"
changeLogFile: "postgresql.sql"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_AURORA_POSTGRESQLURL }}"

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=${{ steps.setup.outputs.databaseVersion }} -Dprefix=aws -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env[format('TH_PGRESURL_{0}', steps.setup.outputs.databaseVersion)] }}' test

- name: AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=${{ steps.setup.outputs.databaseVersion }} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env.TH_ORACLEURL_19 }}' test

- name: AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=${{ steps.setup.outputs.databaseVersion }} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env.TH_MARIADBURL_10_6 }}' test

- name: AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'mysql' && steps.setup.outputs.databaseVersion == 'aws' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=${{ steps.setup.outputs.databaseVersion }} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env.TH_MYSQLURL_8_0 }}' test

- name: AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=${{ steps.setup.outputs.databaseVersion }} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env.TH_MSSQLURL }}' test

- name: AWS Aurora ${{ steps.setup.outputs.databasePlatform }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'mysql' && steps.setup.outputs.databaseVersion == 'aurora' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=${{ steps.setup.outputs.databaseVersion }} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env.TH_AURORA_MYSQLURL }}' test

- name: AWS Aurora ${{ steps.setup.outputs.databasePlatform }} Test Run
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }}
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: mvn -Dtest=${{ needs.setup.outputs.testClasses }} -DconfigFile=/harness-config-cloud.yml -DdbName=${{ steps.setup.outputs.databasePlatform }} -DdbVersion=13 -Dprefix=aurora -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{ env.TH_AURORA_POSTGRESQLURL }}' test

- name: Archive AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Results
uses: actions/upload-artifact@v4
with:
name: aws-rds-${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }}-test-results
path: build/spock-reports

destroy-ephemeral-cloud-infra:
if: always()
needs: [ deploy-ephemeral-cloud-infra, test ]
uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@DAT-17834
secrets: inherit
with:
destroy: true
stack_id: ${{ needs.deploy-ephemeral-cloud-infra.outputs.stack_id }}
aws_test_harness: true
Loading

0 comments on commit 84b5345

Please sign in to comment.