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
3 changes: 1 addition & 2 deletions .github/workflows/repository-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:
matrix:
# Either a literal path, or the name of a secret...
repo:
- "opsmill/infrahub-demo-dc-fabric"
- "opsmill/infrahub-bundle-dc"
- "INFRAHUB_CUSTOMER1_REPOSITORY"
- "INFRAHUB_CUSTOMER2_REPOSITORY"
- "INFRAHUB_CUSTOMER3_REPOSITORY"

steps:
Expand Down
1 change: 1 addition & 0 deletions infrahub_sdk/pytest_plugin/items/python_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def runtest(self) -> None:

class InfrahubPythonTransformIntegrationItem(InfrahubPythonTransformItem):
def runtest(self) -> None:
self.instantiate_transform()
input_data = self.session.infrahub_client.query_gql_query( # type: ignore[attr-defined]
self.transform_instance.query,
variables=self.test.spec.get_variables_data(), # type: ignore[union-attr]
Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/pytest_plugin/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def collect_group(self, group: InfrahubTestGroup) -> Iterable[Item]:
def collect(self) -> Iterable[Item]:
raw = yaml.safe_load(self.path.open(encoding="utf-8"))

if "infrahub_tests" not in raw:
if not raw or "infrahub_tests" not in raw:
return

content = InfrahubTestFileV1(**raw)
Expand Down
6 changes: 4 additions & 2 deletions infrahub_sdk/pytest_plugin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class InfrahubInputOutputTest(InfrahubBaseTest):
directory: Path | None = Field(
None, description="Path to the directory where the input and output files are located"
)
input: Path = Field(
input: Path | None = Field(
Path("input.json"),
description="Path to the file with the input data for the test, can be a relative path from the config file or from the directory.",
)
Expand Down Expand Up @@ -68,7 +68,7 @@ def update_paths(self, base_dir: Path) -> None:
else:
self.directory = base_dir

if not self.input or not self.input.is_file():
if self.input is not None and not self.input.is_file():
search_input: Path | str = self.input or "input.*"
results = list(self.directory.rglob(str(search_input)))

Expand Down Expand Up @@ -99,6 +99,8 @@ def get_output_data(self) -> Any:


class InfrahubIntegrationTest(InfrahubInputOutputTest):
# Integration tests get input from live GraphQL queries, not from input files
input: Path | None = Field(None)
variables: Path | dict[str, Any] = Field(
Path("variables.json"), description="Variables and corresponding values to pass to the GraphQL query"
)
Expand Down