ExportXMLWordPrintableJSON

    • Type: Epic
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • testcontainer-based Testing for CSE
    • Go Drivers
    • Not Needed
    • In Progress
    • 0
    • 0
    • 0
    • 100
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Establish proof-of-concept for testcontainer-based testing prose tests using the CSE (client-side encryption) prose tests as the first implementation; wrapping drivers-evergreen-tools orchestration in testcontainers. CSE prose tests are hard to run locally today because they require manual setup of libmongocrypt, mongocryptd, crypt_shared, and mock KMS servers. This design enables zero-effort local reproduction with CI parity, plus isolated/parallel execution and cleaner test dependency management without polluting consumer dependency trees.

      If we are able to run these test in CI and locally using testcontainers, then we can continue with a broader effort to containerize all prose tests. See GODRIVER-3721 for context.

      Here is a rough shape of the work to be done:

      // internal/test/container package
      
      func ExportSecrets(t testing.T) map[string]string { / ticket 1 */ }
      
      func StartCSEContainer(t *testing.T) CSEContainer { / ticket 2 */ }
      
      type CSEContainer struct{ /* ... */ }
      
      var global *CSEContainer
      
      func Global(t *testing.T) *CSEContainer { return global } // ticket 4
      
      func GoTest(t testing.T, testName string) { / ticket 5 */ }
      
      // internal/test/prose/main_test.go
      
      func TestMain(m *testing.M) {
          if !credentialsFreshOrCI() {
              container.ExportSecrets(t) // ticket 4
          }
          global = container.StartCSEContainer(t,
              container.WithMongoDBURI(hostMongoURI),
              container.WithKMS(t),
          )
          code := m.Run()
          global.Terminate()
          os.Exit(code)
      }
      
      // internal/test/prose/csfle_test.go
      
      func TestClientSideEncryptionProse_27(t *testing.T) {
          container.GoTest(t, "TestClientSideEncryptionProse_27")
      }
      
      // ticket 7: repeat for remaining CSE prose tests
      func TestClientSideEncryptionProse_XX(t *testing.T) {
          container.GoTest(t, "TestClientSideEncryptionProse_XX")
      }
      

      Motivation

      Who is the affected end user?

      Go Driver engineering team, specifically engineers running or debugging CSE prose tests locally

      How does this affect the end user?

      CSE prose tests currently require manual AWS SSO login and libmongocrypt setup, blocking quick local reproduction. Shared orchestration also creates bottlenecks in test execution time, and test-only dependencies (like testify) in the main module trigger confusing CVE reports for consumers who never use them.

      How likely is it that this problem or use case will occur?

      Main path for anyone working on or debugging CSE

      If the problem does occur, what are the consequences and how severe are they?

      Performance concern: slow test feedback loops impact developer productivity. Dependency concern: CVE noise confuses consumers.

      Is this issue urgent?

      Not urgent, but foundational for future test infrastructure improvements.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      Test improvements only no functional impact on driver behavior.

            Assignee:
            Ayesha Islam
            Reporter:
            Preston Vasquez
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              3 weeks, 2 days
              None
              None