-
Notifications
You must be signed in to change notification settings - Fork 11
85 lines (74 loc) · 2.61 KB
/
integration-tests-v1.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Run integration tests V1
on:
workflow_dispatch:
workflow_call:
secrets:
FIREBOLT_STG_USERNAME:
required: true
FIREBOLT_STG_PASSWORD:
required: true
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]" --no-cache-dir
- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v1
with:
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"
- name: Restore cached failed tests
id: cache-tests-restore
uses: actions/cache/restore@v3
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v1
- name: Run integration tests
env:
USER_NAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
API_ENDPOINT: "api.staging.firebolt.io"
ACCOUNT_NAME: "firebolt"
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/functional/ --alluredir=allure-results
- name: Make sure no secrets make it to the logs
if: always()
run: |
find allure-results -type f -exec sed -i 's/${{ secrets.FIREBOLT_STG_USERNAME }}/REDACTED/g' {} +
find allure-results -type f -exec sed -i 's/${{ secrets.FIREBOLT_STG_PASSWORD }}/REDACTED/g' {} +
- name: Save failed tests
id: cache-tests-save
uses: actions/cache/save@v3
if: failure()
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}
- name: Get Allure history
uses: actions/checkout@v2
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Allure Report
uses: firebolt-db/action-allure-report@v1
if: always()
with:
github-key: ${{ secrets.GITHUB_TOKEN }}
test-type: integration-v1