dotnet-opa-wasm icon indicating copy to clipboard operation
dotnet-opa-wasm copied to clipboard

YML-based test automation

Open christophwille opened this issue 2 years ago • 4 comments

Triggered by https://github.com/christophwille/dotnet-opa-wasm/issues/3#issuecomment-955959904

The inner-loop tests should definitely remain in the current unit test project. However, supporting running build verification tests using eg https://github.com/open-policy-agent/opa/tree/main/test/cases/testdata is definitely desireable.

Maybe wrap this in a separate test project so they are split from the inner loop tests. How to include the tests is the 1m question... copy is a no-no, on the other hand I don't want to drag in submodules "just" for this. Ideas welcome.

christophwille avatar Nov 03 '21 09:11 christophwille

To pick on a specific example: https://github.com/iinuwa/dotnet-opa-wasm/commit/a73dbc76fb8ce33e979708722541795da0479d8c

The C#-implemented SDK builtins should be tested directly from a C# unit test, not indirectly via rego (I would consider the latter an "integration test").

christophwille avatar Nov 03 '21 09:11 christophwille

https://github.com/open-policy-agent/opa/issues/3083#issuecomment-954558982

christophwille avatar Nov 04 '21 07:11 christophwille

How to include the tests is the 1m question... copy is a no-no, on the other hand I don't want to drag in submodules "just" for this. Ideas welcome.

What do you mean by copying here? Do you mean you don't want files checked into the repo? If so, the npm-opa-sdk CI downloads the opa repo as a tar and then extracts the subdirectory while running the tests.

The C#-implemented SDK builtins should be tested directly from a C# unit test, not indirectly via rego (I would consider the latter an "integration test").

Agreed. Are you saying that you want the YAML-based tests to be unit or integration tests?

iinuwa avatar Nov 04 '21 14:11 iinuwa

Correct, I don't want the files in this repo - the build automation doing the downloading could be an option. And when I am talking about those "third party tests", I consider them "SDK validation tests" (in a sense we are reusing somebody else's unit tests)

christophwille avatar Nov 04 '21 15:11 christophwille