Git Product home page Git Product logo

Comments (12)

felixfbecker avatar felixfbecker commented on July 17, 2024 1

It's fairly quick actually. Booting up Minikube takes a bit (45s), but every test is faster than you'd think. It kubectl apply's the resources before every test and uses e.g. a deployment of a hello world docker image with imagePullPolicy: IfNotPresent, so recreating pods takes about a second before every test.

from dotnet-kube-client.

felixfbecker avatar felixfbecker commented on July 17, 2024 1

kubectl delete --all deletes all resources in a namespace :)

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

I love this idea - hadn’t had time to do it before but I agree it’s totally worth doing :)

I’ll take a look at PSKubectl’s scripts to see what it would take to set this up (external test suite is a good option, I think, as I don’t expect it to be quick to run?)

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Had a quick look over your CI scripts - that all looks pretty achievable, especially since you’ve done most of the hard work already :)

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

I guess the only tricky bit would be cleaning up after each test :)

Maybe a decorator for IXXXClientVX that captures names of resources created so we can run kubectl delete after the test is complete?

from dotnet-kube-client.

felixfbecker avatar felixfbecker commented on July 17, 2024

What do you need to cleanup? The next test will just kubectl apply the resources again so they get reset

from dotnet-kube-client.

felixfbecker avatar felixfbecker commented on July 17, 2024

kubectl apply --prune also deletes resources

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

What about tests that use the client to create resources?

I guess I could just write a script to delete all resources in a given namespace or something...

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

For gets or deletes though, yeah, it’d be fine.

from dotnet-kube-client.

felixfbecker avatar felixfbecker commented on July 17, 2024

As said kubectl apply --prune should delete all resources that are not present in the input YAML afaik

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Oh - interesting, I hadn’t heard of that usage but that would do the trick :)

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Ah, apparently that only removes resources created by kubectl apply (not ones created by the client). Still, sounds useful :)

from dotnet-kube-client.

Related Issues (20)

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.