Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cursor/rules/testing-patterns.mdc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Testing patterns and conventions for GiGL components
globs: **/test**.py,**/tests/**,testing/**,**/tests/**
globs: **/test**.py,**/tests/**
alwaysApply: false
---
# Testing Patterns & Conventions
Expand Down Expand Up @@ -173,7 +173,7 @@ TEST_EDGES = [
- **Unit tests**: Dir: `tests/unit/` - Fast, isolated tests
- **Integration tests**: Dir: `tests/integration/` - Component interaction tests
- **End-to-end tests**: Defined in `Makefile` target: `_run_e2e_kfp_test` - Test complete workflows
- **Misc repo wide tests**: Dir: `testing`
- **Config/project-level tests**: Dir: `tests/config_tests`

### Test Execution

Expand Down
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ do_not_open_source

# We ignore this folder as it is used to test our orchestration api.
# It simulates how a customer would use GiGL—not as part of a developer workflow.
# See: testing/api_test/README.md for more details.
testing/api_test
# See: tests/api_test/README.md for more details.
tests/api_test

# https://github.com/google-github-actions/auth/issues/497
gha-creds-*.json
46 changes: 23 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DOCKER_IMAGE_MAIN_CUDA_NAME_WITH_TAG?=${DOCKER_IMAGE_MAIN_CUDA_NAME}:${DATE}
DOCKER_IMAGE_MAIN_CPU_NAME_WITH_TAG?=${DOCKER_IMAGE_MAIN_CPU_NAME}:${DATE}
DOCKER_IMAGE_DEV_WORKBENCH_NAME_WITH_TAG?=${DOCKER_IMAGE_DEV_WORKBENCH_NAME}:${DATE}

PYTHON_DIRS:=.github/scripts examples gigl tests snapchat scripts testing
PYTHON_DIRS:=.github/scripts examples gigl tests snapchat scripts
PY_TEST_FILES?="*_test.py"
# You can override GIGL_TEST_DEFAULT_RESOURCE_CONFIG by setting it in your environment i.e.
# adding `export GIGL_TEST_DEFAULT_RESOURCE_CONFIG=your_resource_config` to your shell config (~/.bashrc, ~/.zshrc, etc.)
Expand Down Expand Up @@ -63,13 +63,13 @@ install_deps:
# May include tests that check the sanity of the repo state i.e. ones that may even cause the failure of
# installation scripts
precondition_tests:
uv run python testing/dep_vars_check.py
uv run python tests/config_tests/dep_vars_check.py

run_api_test:
cd testing/api_test && make run_api_test
cd tests/api_test && make run_api_test

assert_yaml_configs_parse:
uv run python testing/assert_yaml_configs_parse.py -d .
uv run python tests/config_tests/assert_yaml_configs_parse.py -d .

# Set PY_TEST_FILES=<TEST_FILE_NAME_GLOB> to test a specifc file.
# Ex. `make unit_test_py PY_TEST_FILES="eval_metrics_test.py"`
Expand Down Expand Up @@ -123,7 +123,7 @@ integration_test:


notebooks_test:
RESOURCE_CONFIG_PATH=${GIGL_TEST_DEFAULT_RESOURCE_CONFIG} python -m testing.notebooks_test
RESOURCE_CONFIG_PATH=${GIGL_TEST_DEFAULT_RESOURCE_CONFIG} python -m tests.config_tests.notebooks_test

mock_assets:
uv run python -m gigl.src.mocking.dataset_asset_mocking_suite --resource_config_uri="deployment/configs/e2e_cicd_resource_config.yaml" --env test
Expand Down Expand Up @@ -189,73 +189,73 @@ push_dev_workbench_docker_image: compile_jars
run_cora_nalp_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_cora_nalp_e2e_test: compile_gigl_kubeflow_pipeline
run_cora_nalp_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="cora_nalp_test"

run_cora_snc_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_cora_snc_e2e_test: compile_gigl_kubeflow_pipeline
run_cora_snc_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="cora_snc_test"

run_cora_udl_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_cora_udl_e2e_test: compile_gigl_kubeflow_pipeline
run_cora_udl_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="cora_udl_test"

run_dblp_nalp_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_dblp_nalp_e2e_test: compile_gigl_kubeflow_pipeline
run_dblp_nalp_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="dblp_nalp_test"

run_hom_cora_sup_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_hom_cora_sup_e2e_test: compile_gigl_kubeflow_pipeline
run_hom_cora_sup_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="hom_cora_sup_test"

run_het_dblp_sup_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_het_dblp_sup_e2e_test: compile_gigl_kubeflow_pipeline
run_het_dblp_sup_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="het_dblp_sup_test"

run_hom_cora_sup_gs_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_hom_cora_sup_gs_e2e_test: compile_gigl_kubeflow_pipeline
run_hom_cora_sup_gs_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="hom_cora_sup_gs_test"

run_het_dblp_sup_gs_e2e_test: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_het_dblp_sup_gs_e2e_test: compile_gigl_kubeflow_pipeline
run_het_dblp_sup_gs_e2e_test:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml" \
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml" \
--test_names="het_dblp_sup_gs_test"

run_all_e2e_tests: compiled_pipeline_path:=${GIGL_E2E_TEST_COMPILED_PIPELINE_PATH}
run_all_e2e_tests: compile_gigl_kubeflow_pipeline
run_all_e2e_tests:
uv run python testing/e2e_tests/e2e_test.py \
uv run python tests/e2e_tests/e2e_test.py \
--compiled_pipeline_path=$(compiled_pipeline_path) \
--test_spec_uri="testing/e2e_tests/e2e_tests.yaml"
--test_spec_uri="tests/e2e_tests/e2e_tests.yaml"

# Compile an instance of a kfp pipeline
# If you want to compile a pipeline and save it to a specific path, set compiled_pipeline_path
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ these tests both locally and on an open PR (leveraring our build/testing system)
echo $GIGL_DOCKER_ARTIFACT_REGISTRY
```

These environment variables override what is defined in the `Makefile`, and when running e2e tests (see: `testing/e2e_tests/e2e_tests.yaml`), allowing you to run tests as discussed below.
These environment variables override what is defined in the `Makefile`, and when running e2e tests (see: `tests/e2e_tests/e2e_tests.yaml`), allowing you to run tests as discussed below.
````

##### Lint/Formatting & Unit Tests
Expand Down Expand Up @@ -258,7 +258,7 @@ All integration tests are organized in `tests/integration` folder with the pytho
##### Cloud Integration Test (end-to-end)

We have a few e2e test entrypoints defined in the Makefile i.e. `run_cora_nalp_e2e_test`, `run_cora_snc_e2e_test`, etc.
You will note that all these tests are defined in `testing/e2e_tests/e2e_tests.yaml`.
You will note that all these tests are defined in `tests/e2e_tests/e2e_tests.yaml`.

```{caution}
As these are very long running tests, we advise you run them on the PR; leveraging commands [pointed out above](#running-tests-against-an-open-pr).
Expand Down
5 changes: 0 additions & 5 deletions testing/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions tests/config_tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Config/project-level test scripts for GiGL.

This folder is intended for tests at a GiGL *project* level, e.g. lint tests and config validation. Unit tests and
integration tests should go in their respective directories e.g. Python [unit](../unit/) and
[integration](../integration/) tests. E2E tests should go in [e2e_tests](../e2e_tests/).
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from pathlib import Path

# We're in GiGL/testing, so we need to go up one level to find gigl/dep_vars.env
DEP_VARS_FILE_PATH = Path.joinpath(Path(__file__).parent.parent, "gigl", "dep_vars.env")
# We're in GiGL/tests/config_tests, so we need to go up two levels to find GiGL/gigl/dep_vars.env
DEP_VARS_FILE_PATH = Path.joinpath(
Path(__file__).parent.parent.parent, "gigl", "dep_vars.env"
)

if __name__ == "__main__":
assert (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.