Skip to content

RPC K/V Matrix Testing Specification

This document specifies the design for a systematic, matrix-based test suite for the RPC Key/Value store example. It focuses on covering all combinations of client/server language implementations and cryptographic configurations.

Testing Matrix Dimensions

1. Language Implementation Combinations

  • Client Languages: go, pyvider
  • Server Languages: go, pyvider
  • Total Combinations: 4 client-server pairs

2. Authentication & Crypto Matrix

  • Authentication Mode: auto_mtls (Automatic mutual TLS with certificate generation)
  • RSA Key Sizes: rsa_2048, rsa_4096
  • Elliptic Curve Options: ec_256 (P-256), ec_384 (P-384), ec_521 (P-521)

This results in 5 unique cryptographic configurations to be tested against each of the 4 language combinations, for a total of 20 distinct test cases.

Implementation Specification

The test suite will be implemented using pytest parameterization.

1. Matrix Configuration (matrix_config.py)

A central file will define the parameters for the matrix, generating a list of pytest.param objects. Each parameter set will contain the client language, server language, and a CryptoConfig object detailing the required mTLS setup.

2. Test Implementation (test_rpc_kv_matrix.py)

A single, parameterized test function, test_rpc_kv_operations_matrix, will execute the core test logic for every combination generated by the matrix configuration. The test logic will: 1. Create an isolated temporary directory for the test run. 2. Start the appropriate server (Go or Python) with the specified crypto configuration. 3. Create a client (Go or Python) configured to connect to the server. 4. Perform PUT, GET, and DELETE operations, verifying the correctness of each. 5. Test error handling, such as getting a non-existent key.

3. Harness Factory (harness/kv_factory.py)

Factory functions (create_kv_server, create_kv_client) will abstract the creation of server and client instances. Based on the language parameter, these factories will return a running instance of either the Go or Python harness, configured for the specific test.

This focused specification ensures systematic validation of RPC K/V functionality across all required language and cryptographic combinations while maintaining clean, maintainable test code.