Giter VIP home page Giter VIP logo

kubeshop / testkube Goto Github PK

View Code? Open in Web Editor NEW
1.3K 19.0 128.0 553.55 MB

☸️ Kubernetes-native testing framework for test execution and orchestration

Home Page: https://testkube.io

License: Other

Makefile 0.90% Go 96.67% Dockerfile 0.23% Shell 0.95% JavaScript 0.93% Batchfile 0.01% PowerShell 0.04% Java 0.11% Python 0.17% HCL 0.01%
kubernetes k8s testing testing-tools cicd devops monitoring quality-assurance testing-automation testkube

testkube's Introduction

Testkube Logo Light Testkube Logo Dark

Welcome to Testkube - Your friendly cloud-native testing framework for Kubernetes

Website |  Documentation |  Twitter |  Slack |  Blog

Click on the image or this link to watch the "Intro to Testkube" short video (3 mins)

Welcome to Testkube

Your friendly cloud-native testing framework for Kubernetes.

Testkube natively integrates test orchestration and execution into Kubernetes and your CI/CD/GitOps pipeline. It decouples test artifacts and execution from CI/CD tooling; tests are meant to be part of your clusters state and can be executed as needed:

  • Kubectl plugin
  • Externally triggered via API (CI, external tooling, etc)
  • Automatically on deployment of annotated/labeled services/pods/etc (WIP)

Testkube advantages:

  • Avoids vendor lock-in for test orchestration and execution in CI/CD pipelines
  • Makes it easy to orchestrate and run any kind of tests - functional, load/performance, security, compliance, etc. in your clusters, without having to wrap them in docker-images or providing network access
  • Makes it possible to decouple test execution from build processes; engineers should be able to run specific tests whenever needed
  • Centralizes all test results in a consistent format for "actionable QA analytics"
  • Provides a modular architecture for adding new types of tests and executors

Main Testkube components are:

  • kubectl Testkube plugin - simple - installed w/o 3rd party repositories (like Krew etc), communicates with
  • API Server - work orchestrator, runs executors, gather execution results
  • CRDs Operator - watches Testkube CR, handles changes, communicates with API Server
  • Executors - runs tests defined for specific runner
  • Results DB - for centralized test results aggregation and analysis

Getting Started

Checkout the Getting Started guides to set up Testkube and run your first tests!

Documentation

Is available at docs.testkube.io

Contributing

Shout-out to our contributors 🎉 - you're great!

Go to contribution document to read more how can you help us 🔥

Feedback

Whether it helps you or not - we'd LOVE to hear from you. Please let us know what you think and of course, how we can make it better Please join our growing community on Slack.

testkube's People

Contributors

aabedraba avatar abhipsnl avatar alelthomas avatar andrewunderwoodatfanatics avatar bishal7679 avatar dejanzele avatar dependabot[bot] avatar devcatalin avatar ed382 avatar edouard-lopez avatar emamihe avatar exu avatar fivenp avatar fog1985 avatar gberche-orange avatar haneabogdan avatar jasmingacic avatar jfermi avatar jmorante-ks avatar kubeshop-bot avatar nicufk avatar olensmar avatar povilasv avatar rangoo94 avatar thebrunolopes avatar tkonieczny avatar vlia avatar vsukhin avatar witodelnat avatar ypoplavs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

testkube's Issues

Implement worker for executor

executor api on posting new script execution
will return 201 - Created and store script execution info in storage.

in parallel workers will check in some intervals what scripts need to be run.

Atomic action from storage need to be supperted (in Mongo we have FindAndModify which lock document)

Put logger in place

(zap looks like good lib to go with) - used by exu previously and by kubebuilder - os we will have only one logger dep.

Create postman executor

Postman executor:

  • run newman process
  • get output as string
  • implement start and
  • get status enpoint (after storage implementation)
  • run should create ID for execution (in separate task - imlpement storage)
  • NTH: limit parallel runs in node to some constant (4?) - separate task

Implement example executor

Curl based simple one-node executor, status storage in-memory - for documentation purpose

  1. create executor from template
  2. clear mongodb
  3. implement runner (create CURLRunnel based on Example runner)
  4. remove worker (we will go with single node)
  5. run inside Start endpoint as goroutine

Common Executor output + renderer

see #31 first

We need to implement common executor result format

  • result owned by kubetest
  • could be quite complicated as need to handle all possible use cases
  • executor will need to implement it
  • renderer will use common output format to return result in given format (text, junit, json etc)

see #66

Example executor docs

Descriptions how to write / (probably later - generate) custom executor

  • based on opeanapi executor definition
  • as simple as possible (w/o scaling issues internal queues storage etc, run on single node)

Error handling for rest endpoints

It would be great to have common error structure for all rest endpoints

Currently most errors are not handled at all

There is several libraries for errors based on
https://github.com/moogar0880/problems
https://github.com/mschneider82/problem
https://pkg.go.dev/github.com/longkai/rfc7807

moogar0880 looks like easiest one to use

Introduced in #23 need to be used everywhere

  • TODO create some easy to use wrapper over http response function (like gofiber c.JSON() function)

Create OpenAPI definition for REST API(s)

I'd prefer a design-first approach to our API interfaces - both internal and external

Add openAPI specification in api folder.
For now endpoints

  • GET /tests gets all tests available (simple w/o paging and filtering
  • POST /tests creates new CR based on CRD
  • PUT /tests/:id updates given test id with test data

Q: are tests good name ?

Create kubectl plugin actions skeleton

Define actions for kubectl kubetest plugin

  1. Starting new script execution
$ kubectl kubetest scripts start SOME_SCRIPT_ID_DEFINED_IN_CR

Script "SCRIPTNAME" started
Execution ID 02wi02-29329-2392930-93939
  • watch for results immediately ?
  • show some output from run ?
  • maybe allow to name/describe your execution (will be easier to check) for example we can run execution for different server config when debugging some issue so we would have several executions (testing_128M testing_200M testing_256M testing_512M)?
  1. Aborting already started script execution
$ kubectl kubetest scripts abort SOME_EXECUTION_ID

Script "SCRIPTNAME" Execution aborted

  1. Getting available scripts
$ kubectl kubetest scripts  list


ID         NAME              Type
040-134   HomePage test      postman-collection   
123-246   Contact API test   postman-collection

  1. Getting available executions
kubectl kubetest scripts executions

ID         NAME             Status     Complete   Start              End
1233-333   HomePage run     pending    75%        2021-07-30 12:33   
1233-332   HomePage run     pending    100%       2021-07-30 12:33   2021-07-30 13:10

What output renderers ?

  • plain text (for the beggining) but prepare model for adding additional renderers
  • json
  • go template

kubetest kubectl plugin - create CR from JSON (import command)

As tester/engineer - I want to simply import my json Postman collections file to kubernetes cluster - next run test

TODO:

  • implement POST /scripts - create new Script CR
  • implement API Client for scripts to create new CR
  • implement scripts import kubectl command (allow importing from stdin

usage:

kubectl kubetest scripts import --file=my_collections.json
#or 
cat my_collections.json | kubectl kubetest scripts import - 

Expose method for getting CRD details by name.

simple method for use inside API for getting CRD details

So to draft what should you do:

  • create /pkg/client/script.go
  • create simple struct with methods ListScripts() []spec.Script (adjust types for real ones 🙂
    )
  • create method GetScript(name string) spec.Spript
  • implement all methods to work with cluster
  • as additional NTH training - check how to test those lib (maybe client-api have directions how to test those endpoints).
  • check how to configure it (on your example config is in cluster config - we need to decide how to use it also on dev machine - it’ll be not in cluster

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.