Skip to content

Commit 5707a93

Browse files
authored
Merge pull request elementary-data#513 from elementary-data/master
Temporarily added workflow_dispatch.
2 parents 7be0494 + 1f9e615 commit 5707a93

File tree

75 files changed

+4967
-3492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4967
-3492
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Release package
22
on:
3+
workflow_dispatch:
34
push:
45
tags:
56
- v[0-9].[0-9]+.[0-9]+
@@ -40,7 +41,6 @@ jobs:
4041

4142
build-and-push-docker-image:
4243
runs-on: ubuntu-latest
43-
needs: publish-to-pypi
4444
permissions:
4545
contents: read
4646
packages: write
@@ -72,14 +72,10 @@ jobs:
7272

7373
merge-to-prod:
7474
runs-on: ubuntu-latest
75-
needs: build-and-push-docker-image
76-
7775
steps:
78-
- name: Checkout Elementary
79-
uses: actions/checkout@v3
80-
81-
- name: Merge 'master' to 'prod'
82-
run: |
83-
git checkout prod
84-
git merge master
85-
git push
76+
- uses: actions/checkout@v3
77+
- name: PR master to prod
78+
uses: repo-sync/pull-request@v2
79+
with:
80+
source_branch: master
81+
destination_branch: prod

.github/workflows/run-unittest.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/test-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
with:
5353
warehouse-type: ${{ matrix.warehouse-type }}
5454
dbt-data-reliability-ref: ${{ needs.get-latest-release-tags.outputs.dbt }}
55-
dbt-version: '1.1.0'
5655
secrets: inherit
5756

5857
recommendation:

.github/workflows/test-warehouse.yml

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ on:
6060

6161
env:
6262
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
63-
TESTS_DIR: dbt-data-reliability/integration_tests
63+
DBT_PKG_INTEG_TESTS_DIR: ${{ github.workspace }}/dbt-data-reliability/integration_tests
6464

6565
jobs:
6666
test:
6767
runs-on: ubuntu-20.04
68+
defaults:
69+
run:
70+
working-directory: elementary
6871
concurrency:
6972
group: tests-${{ inputs.warehouse-type }}-${{ github.head_ref || github.ref_name }}
7073
cancel-in-progress: true
@@ -104,13 +107,12 @@ jobs:
104107
run: pip install dbt-core==${{ inputs.dbt-version }} dbt-${{ inputs.warehouse-type }}==${{ inputs.dbt-version }}
105108

106109
- name: Install Elementary
107-
run: pip install "./elementary[${{ inputs.warehouse-type }}]"
110+
run: |
111+
pip install -r dev-requirements.txt
112+
pip install ".[${{ inputs.warehouse-type }}]"
108113
109-
- name: Upload build artifact
110-
uses: actions/upload-artifact@v3
111-
with:
112-
name: build
113-
path: elementary/build
114+
- name: Run Python package unit tests
115+
run: pytest -vv -k unit
114116

115117
- name: Install dbt package
116118
run: |
@@ -121,48 +123,60 @@ jobs:
121123
rm -rf "$DBT_PKGS_PATH/elementary"
122124
ln -vs "$GITHUB_WORKSPACE/dbt-data-reliability" "$DBT_PKGS_PATH/elementary"
123125
124-
- name: Run E2E tests
126+
- name: Run dbt package integration tests
125127
if: github.event_name != 'workflow_dispatch' || inputs.should-run-tests
128+
working-directory: ${{ env.DBT_PKG_INTEG_TESTS_DIR }}
126129
run: |
127-
dbt deps --project-dir ./dbt-data-reliability/integration_tests
128-
python ./dbt-data-reliability/integration_tests/run_e2e_tests.py -t "${{ inputs.warehouse-type }}" --clear-tests "${{ inputs.clear-tests }}"
130+
dbt deps
131+
python run_e2e_tests.py -t "${{ inputs.warehouse-type }}" --clear-tests "${{ inputs.clear-tests }}"
129132
130133
- name: Run help
131134
run: edr --help
132135

133136
- name: Run monitor
134-
working-directory: ${{ env.TESTS_DIR }}
135137
env:
136138
SLACK_WEBHOOK: ${{ secrets.CI_SLACK_WEBHOOK }}
137-
run: edr monitor -t "${{ inputs.warehouse-type }}" --slack-webhook "$SLACK_WEBHOOK"
139+
run: >
140+
edr monitor
141+
--project-dir "${{ env.DBT_PKG_INTEG_TESTS_DIR }}"
142+
-t "${{ inputs.warehouse-type }}"
143+
--slack-webhook "$SLACK_WEBHOOK"
138144
139145
- name: Run report
140-
working-directory: ${{ env.TESTS_DIR }}
141-
run: edr monitor report -t "${{ inputs.warehouse-type }}" --file-path "report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html"
146+
run: >
147+
edr monitor report
148+
--project-dir "${{ env.DBT_PKG_INTEG_TESTS_DIR }}"
149+
-t "${{ inputs.warehouse-type }}"
142150
143151
- name: Upload report artifact
144152
uses: actions/upload-artifact@v3
145153
with:
146154
name: report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html
147-
path: report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html
155+
path: elementary_report.html
148156

149157
- name: Write GCS keyfile
150158
env:
151159
GCS_KEYFILE: ${{ secrets.GCS_KEYFILE }}
152160
run: echo "$GCS_KEYFILE" | base64 -d > /tmp/gcs_keyfile.json
153161

154162
- name: Run send report
155-
working-directory: ${{ env.TESTS_DIR }}
156163
env:
157164
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }}
158165
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
159166
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
160-
161167
run: >
162-
edr monitor send-report -t "${{ inputs.warehouse-type }}" --slack-file-name "report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html"
163-
--slack-token "$SLACK_TOKEN" --slack-channel-name data-ops --bucket-file-path "ci_reports/report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html"
164-
--aws-access-key-id "$AWS_ACCESS_KEY_ID" --aws-secret-access-key "$AWS_SECRET_ACCESS_KEY" --s3-bucket-name elementary-ci-artifacts
165-
--google-service-account-path /tmp/gcs_keyfile.json --gcs-bucket-name elementary_ci_artifacts
168+
edr monitor send-report
169+
--project-dir "${{ env.DBT_PKG_INTEG_TESTS_DIR }}"
170+
-t "${{ inputs.warehouse-type }}"
171+
--slack-file-name "report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html"
172+
--slack-token "$SLACK_TOKEN"
173+
--slack-channel-name data-ops
174+
--bucket-file-path "ci_reports/report_${{ inputs.warehouse-type }}_${{ env.BRANCH_NAME }}.html"
175+
--aws-access-key-id "$AWS_ACCESS_KEY_ID"
176+
--aws-secret-access-key "$AWS_SECRET_ACCESS_KEY"
177+
--s3-bucket-name elementary-ci-artifacts
178+
--google-service-account-path /tmp/gcs_keyfile.json
179+
--gcs-bucket-name elementary_ci_artifacts
166180
--update-bucket-website true
167181
168182
- name: Upload edr log
@@ -171,3 +185,7 @@ jobs:
171185
with:
172186
name: edr.log
173187
path: edr.log
188+
189+
- name: Run Python package integration tests
190+
if: github.event_name != 'workflow_dispatch' || inputs.should-run-tests
191+
run: pytest -vv -k integration

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM python:3.10.7
22

33
WORKDIR /app
4-
RUN pip install "elementary-data[snowflake, bigquery, redshift, databricks]"
4+
COPY . .
5+
RUN pip install ".[snowflake, bigquery, redshift, databricks]"
56
ENTRYPOINT ["edr"]
7+

0 commit comments

Comments
 (0)