{"id":21126446,"url":"https://github.com/lreimer/hands-on-testkube","last_synced_at":"2025-07-08T23:31:59.541Z","repository":{"id":43421709,"uuid":"460446178","full_name":"lreimer/hands-on-testkube","owner":"lreimer","description":"Demo repository for TestKube - a opinionated and friendly Kubernetes testing framework!","archived":false,"fork":false,"pushed_at":"2024-10-24T12:26:07.000Z","size":275,"stargazers_count":12,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-25T12:57:09.109Z","etag":null,"topics":["demo","gradle","k6","karate-framework","kubernetes","maven","restassured-framework","test-automation","testing","testing-tools","testkube","zap"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lreimer.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-17T13:25:28.000Z","updated_at":"2024-10-24T12:26:11.000Z","dependencies_parsed_at":"2024-05-13T09:26:17.230Z","dependency_job_id":"54be6ba8-1ccc-40c4-8c0f-61bff8aefa06","html_url":"https://github.com/lreimer/hands-on-testkube","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fhands-on-testkube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fhands-on-testkube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fhands-on-testkube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fhands-on-testkube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lreimer","download_url":"https://codeload.github.com/lreimer/hands-on-testkube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470828,"owners_count":17479367,"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":["demo","gradle","k6","karate-framework","kubernetes","maven","restassured-framework","test-automation","testing","testing-tools","testkube","zap"],"created_at":"2024-11-20T04:41:55.102Z","updated_at":"2024-11-20T04:41:55.779Z","avatar_url":"https://github.com/lreimer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hands-on TestKube\n\nDemo repository for TestKube - a opinionated and friendly Kubernetes testing framework!\n\nThis project contains test sources for various languages, frameworks and tools:\n- Load tests to be run with k6\n- JUnit 5 based unit tests to be run with either Maven or Gradle\n- Integration tests using REST-assured to be run with either Maven or Gradle\n- Security test using the ZAP attack proxy\n- Karate acceptance tests to be run with the Karate executor\n\n## Bootstrapping\n\n```bash\n# For a simple local setup use the following instructions\nkubectl testkube init\n\n# to use Testkube Pro setup and connect an agent\n# look at the UI for command with correct tokens\ntestkube pro init --agent-token=tkcagnt_etc.pp --org-id=tkcorg_etc.pp --env-id=tkcenv_etc.pp\n```\n\nFor a GKE based setup using Flux as GitOps tool, use the following instructions:\n```bash\n# define required ENV variables for the next steps to work\nexport GITHUB_USER=lreimer\nexport GITHUB_TOKEN=\u003cyour-token\u003e\n\n# setup a GKE cluster with Flux2\nmake create-gke-cluster\nmake bootstrap-flux2\n\n# modify Flux kustomization and add\n# - infrastructure-sync.yaml\n# - applications-sync.yaml\n# - notification-receiver.yaml\n# - receiver-service.yaml\n# - webhook-token.yaml\n# - image-update-automation.yaml\n\n# if the TestKube Helm release fails to reconciliate\nflux suspend hr testkube\nflux resume hr testkube\n\n# you also need to create the webhook for the Git Repository\n# Payload URL: http://\u003cLoadBalancerAddress\u003e/\u003cReceiverURL\u003e\n# Secret: the webhook-token value\n# kubectl -n flux-system get svc/receiver\n# kubectl -n flux-system get receiver/webapp\n\nmake delete-gke-cluster\n```\n\n## TestKube UI and CLI\n\n```bash\nkubectl testkube --help \nkubectl testkube dashboard\n```\n\n## Postman Executor Example\n\n```bash\nkubectl testkube create test --file src/postman/postman_collection.json --type postman/collection --name postman-test\nkubectl testkube run test postman-test\n\nkubectl testkube create test --file src/postman/postman_collection.json --type postman/collection --name postman-scheduled-test --schedule=\"*/5 * * * *\"\n```\n\n## K6 Executor Example\n\n```bash\n# create simple k6 file based script\nkubectl testkube create test --file src/k6/k6-test-scenarios.js --type \"k6/script\" --name k6-test-script\nkubectl testkube run test --watch k6-test-script\n\n# create Nginx service and k6 load test\nkubectl testkube create test --file src/k6/k6-test-nginx.js --type \"k6/script\" --name k6-test-nginx\nkubectl testkube run test --env TARGET_HOSTNAME=nginx-service.default.svc.cluster.local --watch k6-test-nginx\nkubectl testkube run test --env K6_OUT=influxdb=http://influxdb-service:8086/k6 --env TARGET_HOSTNAME=nginx-service.default.svc.cluster.local --watch k6-test-nginx\n\n# create a generic k6 test for this repository\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --git-path src/k6/ --type \"k6/script\" --name k6-test-script-git\nkubectl testkube run test --args src/k6/k6-test-scenarios.js --watch k6-test-script-git\n\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --git-path src/k6/ --type \"k6/script\" --name k6-test-nginx\nkubectl testkube run test --args src/k6/k6-test-nginx.js --watch k6-test-nginx\n```\n\n## Gradle Executor Example\n\n```bash\n# create a Gradle test for this repository\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type \"gradle/test\" --name gradle-test\nkubectl testkube run test --watch gradle-test\n\n# create a Gradle integrationTest for this repository\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type \"gradle/integrationTest\" --name gradle-integration-test\nkubectl testkube run test --watch gradle-integration-test\n\n# or create a Gradle project and pass test task via args\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type \"gradle/project\" --name gradle-project\nkubectl testkube run test --args integrationTest --watch gradle-project\n```\n\n## Maven Executor Example\n\n```bash\n# create a Maven test for this repository\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type \"maven/test\" --name maven-test\nkubectl testkube run test --watch maven-test\n\n# create a Maven integration test for this repository\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type \"maven/integration-test\" --name maven-integration-test\nkubectl testkube run test --watch maven-integration-test\n\n# or create a Maven project and pass test goal via args\nkubectl testkube create test --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main --type \"maven/project\" --name maven-project\nkubectl testkube run test --args integration-test --watch maven-project\n```\n\n## ZAP Executor Example\n\n```bash\n# register the executor manually or via GitOps\nkubectl apply -n testkube -f k8s/infrastructure/testkube/zap-executor.yaml\n\n# run a ZAP OpenAPI scan against microservice\nkubectl testkube create test --file src/zap/zap-api.yaml --type \"zap/api\" --name zap-api-test\nkubectl testkube run test --watch zap-api-test\n\n# run a ZAP Baseline scan against microservice\nkubectl testkube create test --file src/zap/zap-baseline.yaml --type \"zap/baseline\" --name zap-baseline-test\nkubectl testkube run test --watch zap-baseline-test\n```\n\n## Karate Executor Example\n\n```bash\n# register the executor manually or via GitOps\nkubectl apply -n testkube -f k8s/infrastructure/testkube/karate-executor.yaml\n\n# create and run a Karate test agains Chuck Norris REST API\nkubectl testkube create test --file src/karate/chuck-norris.feature --type \"karate/feature\" --name karate-test\nkubectl testkube run test --watch karate-test\n```\n\n## TestSource Example\n\n```bash\nkubectl testkube create testsource --name hands-on-testkube --git-uri https://github.com/lreimer/hands-on-testkube.git --git-branch main\n\nkubectl testkube create test --source hands-on-testkube --type \"k6/script\" --name k6-testsource\nkubectl testkube run test --args src/k6/k6-test-scenarios.js --watch k6-testsource\n```\n\n## TestSuite Example\n\n```bash\n# manually create and run a test suite from JSON\nkubectl testkube create testsuite --name hands-on-testkube --file src/suite.json\nkubectl get testsuites -n testkube hands-on-testkube  -o yaml\nkubectl testkube run testsuite hands-on-testkube\n\n# alternatively, create test suite via GitOps\n# see k8s/applications/testsuite.yaml\n# this uses the new test workflow CRD\n```\n\n## GitHub Actions Example\n\n```bash\n# see .github/workflows/testkube.yaml\n# see https://github.com/lreimer/hands-on-testkube/actions/workflows/testkube.yaml\n```\n\n## Test Triggers Example\n\n```bash\n# register the test triggers manually or via GitOps\nkubectl apply -n testkube -f k8s/applications/testtrigger.yaml\nkubectl apply -n testkube -f k8s/applications/zap-demo/zap-api-testtrigger.yaml\n\n# then make changes to the Nginx or Microservice deployment\nkubectl scale deployment nginx-deployment --replicas=3\nkubectl scale deployment hands-on-testkube --replicas=3\n```\n\n## Maintainer\n\nM.-Leander Reimer (@lreimer), \u003cmario-leander.reimer@qaware.de\u003e\n\n## License\n\nThis software is provided under the MIT open source license, read the `LICENSE`\nfile for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flreimer%2Fhands-on-testkube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flreimer%2Fhands-on-testkube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flreimer%2Fhands-on-testkube/lists"}