Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests using infrahub-testcontainers #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dgarros
Copy link
Contributor

@dgarros dgarros commented Jan 11, 2025

This PR provide an example an how to setup an integration test for a git repository that is designed to be integrated within infrahub.

The tests are using the package infrahub-testcontainers to start Infrahub locally using docker compose.

Using the utility GitRepo from infrahub_sdk.testing.repository, it's possible to convert all the local files into a new Git repository and to import it in Infrahub locally, without requiring access to a remote git server.

infrahub-testcontainers also provide a way to execute local script using infrahubctl run, in this example we after loading the schema we are executing the 4 data loaders scripts using this method.

This example is using asyncio but it's also possible to use the standard client by replacing the fixture client with client_sync

Various Notes

Copy link

cloudflare-workers-and-pages bot commented Jan 11, 2025

Deploying infrahub-demo-dc-fabric with  Cloudflare Pages  Cloudflare Pages

Latest commit: ab6daee
Status: ✅  Deploy successful!
Preview URL: https://a78dcb43.infrahub-demo-dc-fabric.pages.dev
Branch Preview URL: https://dga-20250111-integration-tes.infrahub-demo-dc-fabric.pages.dev

View logs

@dgarros dgarros force-pushed the dga-20250111-integration-tests branch from 24da0c0 to ab6daee Compare January 12, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant