Giter VIP home page Giter VIP logo

Comments (5)

lpabon avatar lpabon commented on May 21, 2024

I discussed this with @chakri-nelluri and here is my proposal.

I have a PoC of a framework just to do a "sanity" test of a driver. This can be expanded as it matures in the future

Usage

  • Use as a standard Unit Test where the driver does the following:
func TestDriver(t *testing.T) {
       // Setup the driver. Driver in this example needs to be adjusted for tesing
        d := NewDriver()
        err := d.Start()
        assert.NotNil(err)
        defer d.Stop()

        // Start Sanity test
        tester := driver.NewDriverSanityTester(t, d.Address())
        tester.Run()
}
  • As a program for non-Golang drivers
$ sanity --endpoint <...>

Implementation

Here is the pseudo-code of the implementation:

type DriverSanityTester struct {
        conn *grpc.ClientConn
        t    *testing.T
}

func NewDriverSanityTester(t *testing.T, address string) *DriverSanityTester {
        conn, err := grpc.Dial(address, grpc.WithInsecure())
        assert.Nil(t, err)
        return &DriverSanityTester{
                t:    t,
                conn: conn,
        }
}

func (d *DriverSanityTester) Run() {
        RegisterFailHandler(Fail)
        var _ = Describe("Identity Server", func() {
                var c csi.IdentityClient

                BeforeEach(func() {
                        c = csi.NewIdentityClient(d.conn)
                })

                It("should fail when no version is provided", func() {
                        _, err := c.GetPluginInfo(context.Background(), &csi.GetPluginInfoRequest{})
                        Expect(err).NotTo(HaveOccurred())
                })
        })
        RunSpecs(d.t, "CSI Driver Sanity Suite")
}

from drivers.

fejta-bot avatar fejta-bot commented on May 21, 2024

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

from drivers.

fejta-bot avatar fejta-bot commented on May 21, 2024

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

from drivers.

fejta-bot avatar fejta-bot commented on May 21, 2024

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

from drivers.

k8s-ci-robot avatar k8s-ci-robot commented on May 21, 2024

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from drivers.

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.