{"id":19144179,"url":"https://github.com/crossplane/uptest","last_synced_at":"2025-05-07T01:09:56.332Z","repository":{"id":227637683,"uuid":"763649515","full_name":"crossplane/uptest","owner":"crossplane","description":"The end to end testing tool for @crossplane providers and configurations.","archived":false,"fork":false,"pushed_at":"2025-04-16T07:32:09.000Z","size":619,"stargazers_count":19,"open_issues_count":10,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-07T01:09:42.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crossplane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-26T17:20:03.000Z","updated_at":"2025-05-02T14:49:45.000Z","dependencies_parsed_at":"2024-11-09T07:35:37.669Z","dependency_job_id":"02b9441b-54f5-4d68-a821-89eea8e9d4ec","html_url":"https://github.com/crossplane/uptest","commit_stats":null,"previous_names":["crossplane/uptest"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplane%2Fuptest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplane%2Fuptest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplane%2Fuptest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossplane%2Fuptest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crossplane","download_url":"https://codeload.github.com/crossplane/uptest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793650,"owners_count":21805057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T07:34:02.183Z","updated_at":"2025-05-07T01:09:56.289Z","avatar_url":"https://github.com/crossplane.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UPTEST\n\n_Note:_ The `uptest` tool used to live in the https://github.com/upbound/uptest\nrepository. We have moved it to this repository\n(https://github.com/crossplane/uptest) and kept the old repository instead of\nrenaming it because the provider reusable CI workflows and the other CI tooling\nsuch as `crddiff` or `updoc` still reside in there.\n\nThe end to end integration testing tool for Crossplane providers and configurations.\n\nUptest comes as a binary which can be installed from the releases section. It runs end-to-end tests\nby applying the provided examples and waiting for the expected conditions. Other than that, it enables templating to\ninsert dynamic values into the examples and supports running scripts as hooks just before and right after applying\nthe examples.\n\n## Usage\n\n```shell\n$ uptest e2e --help\nusage: uptest e2e [\u003cflags\u003e] [\u003cmanifest-list\u003e]\n\nRun e2e tests for manifests by applying them to a control plane and waiting until a given condition is met.\n\nFlags:\n  --help                        Show context-sensitive help (also try --help-long and --help-man).\n  --data-source=\"\"              File path of data source that will be used for injection some values.\n  --setup-script=\"\"             Script that will be executed before running tests.\n  --teardown-script=\"\"          Script that will be executed after running tests.\n  --default-timeout=1200        Default timeout in seconds for the test. Timeout could be overridden per resource using\n                                \"uptest.upbound.io/timeout\" annotation.\n  --default-conditions=\"Ready\"  Comma seperated list of default conditions to wait for a successful test. Conditions could be\n                                overridden per resource using \"uptest.upbound.io/conditions\" annotation.\n\nArgs:\n  [\u003cmanifest-list\u003e]  List of manifests. Value of this option will be used to trigger/configure the tests.The possible usage:\n                     'provider-aws/examples/s3/bucket.yaml,provider-gcp/examples/storage/bucket.yaml': The comma separated resources\n                     are used as test inputs. If this option is not set, 'MANIFEST_LIST' env var is used as default.\n```\n\nUptest expects a running control-plane (a.k.a. k8s + crossplane) where required providers are running and/or required\nconfiguration were applied.\n\nExample run:\n\n```shell\nuptest e2e examples/user.yaml,examples/bucket.yaml --setup-script=\"test/hooks/setup.sh\"\n```\n\n### Injecting Dynamic Values (and Datasource)\n\nUptest supports injecting dynamic values into the examples by using a data source. The data source is a yaml file\nstoring key-value pairs. The values can be used in the examples by using the following syntax:\n\n```\n${data.key}\n```\n\nExample data source file content:\n\n```yaml\naws_account_id: 123456789012\naws_region: us-east-1\n```\n\nExample manifest:\n\n```yaml\napiVersion: athena.aws.upbound.io/v1beta1\nkind: DataCatalog\nmetadata:\n  labels:\n    testing.upbound.io/example-name: example\n  name: example\nspec:\n  forProvider:\n    description: Example Athena data catalog\n    parameters:\n      function: arn:aws:lambda:${data.aws_region}:${data.aws_account_id}:function:upbound-example-function\n    region: us-west-1\n    tags:\n      Name: example-athena-data-catalog\n    type: LAMBDA\n```\n\nUptest also supports generating random strings as follows:\n\n```\n${Rand.RFC1123Subdomain}\n```\n\nExample Manifest:\n\n```yaml\napiVersion: s3.aws.upbound.io/v1beta1\nkind: Bucket\nmetadata:\n  name: ${Rand.RFC1123Subdomain}\n  labels:\n    testing.upbound.io/example-name: s3\nspec:\n  forProvider:\n    region: us-west-1\n    objectLockEnabled: true\n    tags:\n      Name: SampleBucket\n```\n\n### Hooks\n\nThere are 6 types of hooks that can be used to customize the test flow:\n\n1. `setup-script`: This hook will be executed before running the tests case. It is useful to set up the control plane\n   before running the tests. For example, you can use it to create a provider config and your cloud credentials. This\n   can be configured via `--setup-script` flag as a relative path to where uptest is executed.\n2. `teardown-script`: This hook will be executed after running the tests case. This can be configured via\n   `--teardown-script` flag as a relative path to where uptest is executed.\n3. `pre-assert-hook`: This hook will be executed before running the assertions and after applying a specific manifest.\n    This can be configured via `uptest.upbound.io/pre-assert-hook` annotation on the manifest as a relative path to the\n    manifest file.\n4. `post-assert-hook`: This hook will be executed after running the assertions. This can be configured via\n    `uptest.upbound.io/post-assert-hook` annotation on the manifest as a relative path to the manifest file.\n5. `pre-delete-hook`: This hook will be executed just before deleting the resource. This can be configured via\n    `uptest.upbound.io/pre-delete-hook` annotation on the manifest as a relative path to the manifest file.\n6. `post-delete-hook`: This hook will be executed right after the resource is deleted. This can be configured via\n   `uptest.upbound.io/post-delete-hook` annotation on the manifest as a relative path to the manifest file.\n\n\u003e All hooks need to be executables, please make sure to set the executable bit on your scripts, e.g. with `chmod +x`.\n\n### Troubleshooting\n\nUptest uses [Chainsaw](https://github.com/kyverno/chainsaw) under the hood and generates a `chainsaw` test cases based on the provided input.\nYou can render and inspect the generated chainsaws test cases by using uptest\n`--render-only` flag and checking the output directory. For example:\n\n```shell\nuptest e2e examples/kcl/network-xr.yaml --setup-script=test/setup.sh --render-only\n\n2024/11/01 22:20:46 Skipping update step because the root resource does not exist\n2024/11/01 22:20:46 Written test files: /var/folders/sx/0tlfb9ys20bbqnszv3lw12m40000gn/T/uptest-e2e\n\nls -1 /var/folders/sx/0tlfb9ys20bbqnszv3lw12m40000gn/T/uptest-e2e/case/\n00-apply.yaml\n02-import.yaml\n03-delete.yaml\ntest-input.yaml\n```\n\n## Report a Bug\n\nFor filing bugs, suggesting improvements, or requesting new features, please\nopen an [issue](https://github.com/crossplane/uptest/issues).\n\n## Licensing\n\nUptest is under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossplane%2Fuptest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrossplane%2Fuptest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossplane%2Fuptest/lists"}