Skip to content

Commit 27b2a4b

Browse files
committed
feat: add option to run core integration tests on kind
1 parent fbacfd5 commit 27b2a4b

4 files changed

Lines changed: 447 additions & 51 deletions

File tree

.github/workflows/integration-tests-core.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
python -m pip install --upgrade pip
7070
pip install ".[dev]"
7171
72-
- name: Run integration tests HTTP
72+
- name: "Compose: Run integration tests HTTP"
7373
env:
7474
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
7575
SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
@@ -80,9 +80,9 @@ jobs:
8080
ACCOUNT_NAME: ""
8181
CORE_URL: ${{ steps.setup-core.outputs.service_url }}
8282
run: |
83-
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --alluredir=allure-results/
83+
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --run-compose --alluredir=allure-results/
8484
85-
- name: Run integration tests HTTPS
85+
- name: "Compose: Run integration tests HTTPS"
8686
env:
8787
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
8888
SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
@@ -93,7 +93,13 @@ jobs:
9393
ACCOUNT_NAME: ""
9494
CORE_URL: ${{ steps.setup-core.outputs.service_https_url }}
9595
run: |
96-
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --alluredir=allure-results-https/
96+
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --run-compose --alluredir=allure-results-https/
97+
98+
- name: "Kind: Run integration tests HTTP"
99+
env:
100+
CORE_HELM_CHART_VERSION: "0.3.0"
101+
run: |
102+
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --run-kind --alluredir=allure-results-kind/
97103
98104
- name: Allure Reports
99105
uses: firebolt-db/action-allure-report@8cdc116f65f6eca845a992e347e72b75ca8ccf5f # v2.1.1
@@ -104,5 +110,6 @@ jobs:
104110
mapping-json: |
105111
{
106112
"allure-results": "core",
107-
"allure-results-https": "core_https"
113+
"allure-results-https": "core_https",
114+
"allure-results-kind": "core_kind"
108115
}

CONTRIBUTING.MD

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Optionally setup PyCharm linting shortcut:
1616
Name: lint
1717
Description: Format the current file
1818
Program: $PyInterpreterDirectory$/pre-commit
19-
Arguments: run --files=$FilePath$Working
19+
Arguments: run --files=$FilePath$Working
2020
Working Directory: $ProjectFileDir$
2121
```
22-
2. Preferences -> Keymap -> External Tools -> lint,
22+
2. Preferences -> Keymap -> External Tools -> lint,
2323
Assign the keyboard shortcut `Option-cmd-l`
2424

2525
### Before Committing
@@ -28,8 +28,8 @@ Working Directory: $ProjectFileDir$
2828
2. run `mypy src` to check for type errors
2929
3. run `pytest tests/unit` to run unit tests
3030

31-
Note: while there is a `mypy` hook for pre-commit,
32-
I found it too buggy to be worthwhile, so I just run mypy manually.
31+
Note: while there is a `mypy` hook for pre-commit,
32+
I found it too buggy to be worthwhile, so I just run mypy manually.
3333

3434
### PR procedures
3535

@@ -44,13 +44,35 @@ I found it too buggy to be worthwhile, so I just run mypy manually.
4444
4. If the integration tests pass and the change looks good to the maintainer they approve it.
4545
5. Merge into the main branch. Only the maintainers have the ability to merge a PR. They will do so at the earliest convenience, with regards to the impact of the change as well as the release planning.
4646

47+
### Integration Tests
48+
The integration test suite runs against Firebolt SaaS v1, Firebolt SaaS v2 and Firebolt Core. The SaaS test suites only run as part of the CI. Locally you can run the Firebolt Core test suite.
49+
50+
#### Run the tests locally
51+
52+
**Run on Kind:**
53+
You must have [kind](https://kind.sigs.k8s.io/) installed. The test driver will create a kind cluster and install the Firebolt Core Helm chart.
54+
55+
```shell
56+
pytest -k "core" --run-kind tests/integration
57+
```
58+
59+
**Run on Docker Compose:**
60+
```shell
61+
pytest -k "core" --run-compose tests/integration
62+
```
63+
64+
### Include a test in the core suite
65+
Not all integration tests are supported by Firebolt Core.
66+
67+
The tests that are supported, use `@fixture(params=["core"])` on the fixture. Other ways are to use a `core` mark or add `core` in the name of the test. For more details on how tests are selected with the `pytest -k` flag, please check the pytest documentation.
68+
4769
### Docstrings
4870

49-
Use the Google format for docstrings. Do not include types or an indication
50-
of "optional" in docstrings. Those should be captured in the function signature
71+
Use the Google format for docstrings. Do not include types or an indication
72+
of "optional" in docstrings. Those should be captured in the function signature
5173
as type annotations; no need to repeat them in the docstring.
5274

53-
Public methods and functions should have docstrings.
75+
Public methods and functions should have docstrings.
5476
One-liners are fine for simple methods and functions.
5577

5678
For PyCharm Users:
@@ -73,20 +95,20 @@ In general, organize class internals in this order:
7395
* alternative constructors first
7496
* other classmethods next
7597
4. properties (`@property`)
76-
5. remaining methods
98+
5. remaining methods
7799
* put more important / broadly applicable functions first
78100
* group related functions together to minimize scrolling
79101

80-
Read more about this philosophy
102+
Read more about this philosophy
81103
[here](https://softwareengineering.stackexchange.com/a/199317).
82104

83105
### Huge classes
84106

85-
If classes start to approach 1k lines, consider breaking them into parts,
107+
If classes start to approach 1k lines, consider breaking them into parts,
86108
possibly like [this](https://stackoverflow.com/a/47562412).
87109

88110
### Versioning
89111

90-
Consider adopting:
112+
Consider adopting:
91113
* https://packboard.atlassian.net/wiki/x/AYC6aQ
92114
* https://python-semantic-release.readthedocs.io/en/latest/

kind.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
kind: Cluster
3+
apiVersion: kind.x-k8s.io/v1alpha4
4+
nodes:
5+
- role: control-plane
6+
- role: worker
7+
- role: worker

0 commit comments

Comments
 (0)