cedar-policy / cedar-go

Golang implementation of the Cedar Policy Language
Apache License 2.0
83 stars 9 forks source link

cedar-go: run integration tests as part of the regular test suite #23

Closed patjakdev closed 4 months ago

patjakdev commented 4 months ago

Issue #, if available: None

Description of changes:

This change adds a local copy of the corpus-tests.tar.gz from the upstread cedar-policy/cedar-integration-tests repo and a test harness which loads the tests in-memory and runs them.

This will allow us to run these tests as part of our continuous integration pipeline and should reduce noise due to network blips. It will also mean that upstream changes to the formatting of the tests won't instantly break the test runner, leaving developers unsure if their code is correct or not.

The tests run in just over 1 second on my dev machine, so I see no harm in running them on every PR.

Additionally, the nightly test corpus run has been transformed into a check for a difference in the upstream version and the local version of the tests. If a change happens upstream, an issue will be opened which we can use to track updating the local copy of the tests.

patjakdev commented 4 months ago

You can see an illustration of the new Github action running here: https://github.com/strongdm/cedar-go/actions/runs/9813207947/job/27098758808