components-contrib/tests/certification/state/sqlserver
Josh van Leeuwen 9be6d157a4
tests/certification: Updates dapr/dapr to `master` HEAD (#3084)
Signed-off-by: joshvanl <me@joshvanl.dev>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-08-21 17:06:55 -07:00
..
components SQL Server Certification Tests (#1265) 2021-11-03 10:35:34 -07:00
README.md Adds TTL support to SQL Server using SQL Cleanup Strategy (#2682) 2023-03-20 20:04:17 +00:00
config.yaml SQL Server Certification Tests (#1265) 2021-11-03 10:35:34 -07:00
docker-compose.yml [release-1.11] Cherry-pick sql server fixes #2912 (#2920) 2023-06-20 09:11:09 -07:00
sqlserver_test.go tests/certification: Updates dapr/dapr to `master` HEAD (#3084) 2023-08-21 17:06:55 -07:00

README.md

SQL Server certification testing

This project aims to test the SQL Server State Store component under various conditions.

Test plan

SQL Injection

  • Not prone to SQL injection on write
  • Not prone to SQL injection on read
  • Not prone to SQL injection on delete

Indexed Properties

  • Verifies Indices are created for each indexed property in component metadata
  • Verifies JSON data properties are parsed and written to dedicated database columns

Custom Properties

  • Verifies the use of custom tablename (default is states)
  • Verifies the use of a custom schema (default is dbo)

Connection to different SQL Server types

  • Verifies connection handling with Azure SQL Server
  • Verifies connection handling with SQL Server in Docker to represent self hosted SQL Server options

TTLs and cleanups

  1. Correctly parse the cleanupIntervalInSeconds metadata property:
    • No value uses the default value (3600 seconds)
    • A positive value sets the interval to the given number of seconds
    • A zero or negative value disables the cleanup
  2. The cleanup method deletes expired records and updates the metadata table with the last time it ran
  3. The cleanup method doesn't run if the last iteration was less than cleanupIntervalInSeconds or if another process is doing the cleanup

Other tests

  • Client reconnects (if applicable) upon network interruption

Running the tests

This must be run in the GitHub Actions Workflow configured for test infrastructure setup.

If you have access to an Azure subscription you can run this locally on Mac or Linux after running setup-azure-conf-test.sh in .github/infrastructure/conformance/azure and then sourcing the generated bash rc file.