Skip to content

Commit

Permalink
INC-2124 Fix ubuntu deprecation (#252)
Browse files Browse the repository at this point in the history
* upgrade ubuntu version and split linux and windoes mac tests

* do the ubuntu upgrade
  • Loading branch information
emmyoop authored Mar 5, 2025
1 parent e1c4f48 commit bc6a098
Showing 1 changed file with 86 additions and 8 deletions.
94 changes: 86 additions & 8 deletions .github/workflows/ci_dbt_core_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
echo "include=${INCLUDE_GROUPS}"
echo "include=${INCLUDE_GROUPS}" >> $GITHUB_OUTPUT
dbt-core-integration-tests:
dbt-core-integration-tests-ubuntu:
name: "(${{ matrix.split-group }}) integration test / python ${{ matrix.python-version }} / ${{ matrix.os }}"
if: ${{ github.event_name != 'pull_request' && !contains(github.event.label.name, 'Skip Core Testing')}}

Expand All @@ -196,14 +196,30 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-20.04]
os: [ubuntu-latest]
split-group: ${{ fromJson(needs.dbt-core-integration-metadata.outputs.split-groups) }}
include: ${{ fromJson(needs.dbt-core-integration-metadata.outputs.include) }}
env:
DBT_INVOCATION_ENV: github-actions
DBT_TEST_USER_1: dbt_test_user_1
DBT_TEST_USER_2: dbt_test_user_2
DBT_TEST_USER_3: dbt_test_user_3
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: "Check out the repository@${{ needs.job-prep.outputs.dbt-core-ref }}"
Expand All @@ -217,9 +233,71 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: "Set up postgres (linux)"
if: runner.os == 'Linux'
uses: ./.github/actions/setup-postgres-linux
- name: Run postgres setup script
run: |
./test/setup_db.sh
env:
PGHOST: localhost
PGPORT: 5432
PGPASSWORD: password

- name: "Upgrade pip, install tox"
run: |
python -m pip install --upgrade pip
python -m pip --version
python -m pip install tox
tox --version
- name: "Update dbt-common dependency to ${{ needs.job-prep.outputs.dbt-common-ref }}"
run: |
./scripts/update_dev_packages.sh ${{ github.repository.name}} ${{ needs.job-prep.outputs.dbt-common-ref }}
- name: "Run Functional tests"
run: tox -- --ddtrace
env:
TOXENV: integration
DBT_INVOCATION_ENV: github-actions
DBT_TEST_USER_1: dbt_test_user_1
DBT_TEST_USER_2: dbt_test_user_2
DBT_TEST_USER_3: dbt_test_user_3
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
DD_SITE: datadoghq.com
DD_ENV: ci
DD_SERVICE: dbt-core
PYTEST_ADDOPTS: ${{ format('--splits {0} --group {1}', env.PYTHON_INTEGRATION_TEST_WORKERS, matrix.split-group) }}

- name: "Check installed versions"
run: pip freeze

dbt-core-integration-tests-mac-windows:
name: "(${{ matrix.split-group }}) integration test / python ${{ matrix.python-version }} / ${{ matrix.os }}"
if: ${{ github.event_name != 'pull_request' && !contains(github.event.label.name, 'Skip Core Testing')}}

runs-on: ${{ matrix.os }}
timeout-minutes: 30
needs: [job-prep, dbt-core-integration-metadata]
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.dbt-core-integration-metadata.outputs.include) }}
env:
DBT_INVOCATION_ENV: github-actions
DBT_TEST_USER_1: dbt_test_user_1
DBT_TEST_USER_2: dbt_test_user_2
DBT_TEST_USER_3: dbt_test_user_3

steps:
- name: "Check out the repository@${{ needs.job-prep.outputs.dbt-core-ref }}"
uses: actions/checkout@v4
with:
repository: dbt-labs/dbt-core
ref: ${{ needs.job-prep.outputs.dbt-core-ref }}

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: "Set up postgres (macos)"
if: runner.os == 'macOS'
Expand Down Expand Up @@ -262,10 +340,10 @@ jobs:
if: ${{ always() }}
name: "dbt-core Integration Test Suite Report"
runs-on: ubuntu-latest
needs: [dbt-core-integration-tests]
needs: [dbt-core-integration-tests-ubuntu, dbt-core-integration-tests-mac-windows]
steps:
- name: "Integration Tests Failed"
if: ${{ contains(needs.dbt-core-integration-tests.result, 'failure') || contains(needs.dbt-core-integration-tests.result, 'cancelled') }}
if: ${{ contains(needs.dbt-core-integration-tests-ubuntu.result, 'failure') || contains(needs.dbt-core-integration-tests-ubuntu.result, 'cancelled') || contains(needs.dbt-core-integration-tests-mac-windows.result, 'failure') || contains(needs.dbt-core-integration-tests-mac-windows.result, 'cancelled') }}
# when this is true the next step won't execute
run: |
echo "::notice title='Integration test suite failed'"
Expand Down

0 comments on commit bc6a098

Please sign in to comment.