-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pyright and e2e tests for CI/CD (#53)
* add pyright and e2e tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * check for ci/cd * fix return logic * fix -it flags * fix tty * fix concurrency --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b81938a
commit c1abbaf
Showing
21 changed files
with
171 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: E2E Dagster build | ||
|
||
on: | ||
push: | ||
workflow_dispatch: # Allows manual triggering of the workflow | ||
|
||
jobs: | ||
setup-docker-and-run: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Set up Docker | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Run the Python script that handles the build and execution | ||
- name: Launch Docker Stack and run tests | ||
run: python3 main.py local && python3 main.py test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Pyright Type Checks | ||
|
||
on: | ||
push: | ||
workflow_dispatch: # Allows manual triggering of the workflow | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
cache: "pip" | ||
|
||
- run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install -r Docker/user_code_requirements.txt | ||
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | ||
|
||
- uses: jakebailey/pyright-action@v2 | ||
with: | ||
pylance-version: latest-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from dagster import load_assets_from_modules, materialize | ||
import userCode.main as main | ||
|
||
|
||
from dagster import AssetsDefinition, AssetSpec, SourceAsset | ||
|
||
|
||
def test_materialize_configs(): | ||
assets = load_assets_from_modules([main]) | ||
# It is possible to load certain asset types that cannot be passed into | ||
# Materialize so we filter them to avoid a pyright type error | ||
filtered_assets = [ | ||
asset | ||
for asset in assets | ||
if isinstance(asset, (AssetsDefinition, AssetSpec, SourceAsset)) | ||
] | ||
result = materialize( | ||
assets=filtered_assets, | ||
selection=["nabu_config", "gleaner_config", "docker_client_environment"], | ||
) | ||
assert result.success |