Skip to content

Splitting CSI Sanity unit and E2E tests #52

@davidz627

Description

@davidz627

Looking at CSI Sanity, it seems that it is running unit and e2e tests in the same framework.

For example in one suite "NodeUnpublishVolume" it will have unit tests like "should fail when no volume id is provided." That could be exercised on the driver with mocked out back-ends. This makes sure there are no side-effects or other unrelated errors that arise from this test hitting real back-ends.

And in the same suite "NodeUnpublishVolume" there is an e2e test "should return appropriate values (no optional values added)" which is exercising the entire workflow of creating, controller publish, node publish, node unpublish, controller unpublish, and deletevolume. This exact same e2e test is also duplicated in the "NodePublishVolume" suite as the "test should return appropriate values (no optional values added)" test.

I propose that we split the existing sanity testing framework into two parts, one for unit tests to exercise single RPC calls for their various error conditions and sanity check their basic functionality with mocked out backends. And a second e2e sanity testing framework designed to be run with a production backend that can exercise end to end workflows of creating actual volumes and various error cases with respect to that.

This would solve a few problems:

  1. Unit testing is sped up because it will not hit production backends
  2. E2E Tests will no longer be duplicated across different suites ("should return appropriate values (no optional values added)")
  3. Unit/e2e tests can be run in different environments (unit with mock backend, e2e with production backend for example)
  4. Frees up room to write more extensive e2e tests failure modes like "controller publish before createvolume" or "Node stage capability specified but NodeStageVolume not called"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions