Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export API functional tests #1400

Open
1 task done
miparnisari opened this issue Feb 26, 2024 · 1 comment
Open
1 task done

Export API functional tests #1400

miparnisari opened this issue Feb 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@miparnisari
Copy link
Member

Checklist

Describe the problem you'd like to have solved

func TestFunctionalGRPC(t *testing.T) {
// uncomment when https://github.com/hashicorp/go-retryablehttp/issues/214 is solved
//defer goleak.VerifyNone(t)
client := newOpenFGAServerAndClient(t)
t.Run("TestCreateStore", func(t *testing.T) { GRPCCreateStoreTest(t, client) })
t.Run("TestGetStore", func(t *testing.T) { GRPCGetStoreTest(t, client) })
t.Run("TestDeleteStore", func(t *testing.T) { GRPCDeleteStoreTest(t, client) })
t.Run("TestWrite", func(t *testing.T) { GRPCWriteTest(t, client) })
t.Run("TestRead", func(t *testing.T) { GRPCReadTest(t, client) })
t.Run("TestReadChanges", func(t *testing.T) { GRPCReadChangesTest(t, client) })
t.Run("TestCheck", func(t *testing.T) { GRPCCheckTest(t, client) })
t.Run("TestListObjects", func(t *testing.T) { GRPCListObjectsTest(t, client) })
t.Run("TestWriteAuthorizationModel", func(t *testing.T) { GRPCWriteAuthorizationModelTest(t, client) })
t.Run("TestReadAuthorizationModel", func(t *testing.T) { GRPCReadAuthorizationModelTest(t, client) })
t.Run("TestReadAuthorizationModels", func(t *testing.T) { GRPCReadAuthorizationModelsTest(t, client) })
t.Run("TestWriteAssertions", func(t *testing.T) { GRPCWriteAssertionsTest(t, client) })
t.Run("TestWriteAuthorizationModel", func(t *testing.T) { GRPCWriteAuthorizationModelTest(t, client) })
t.Run("TestReadAuthorizationModel", func(t *testing.T) { GRPCReadAuthorizationModelTest(t, client) })
t.Run("TestReadAuthorizationModels", func(t *testing.T) { GRPCReadAuthorizationModelsTest(t, client) })
}
are private to this repository.

Describe the ideal solution

Any wrappers of OpenFGA, including but not limited to Okta FGA, should be able to run these tests to ensure API compatibility (for example. that they do the same API input validations).

We should make tests public (exported), similar to

// RunAllTests will run all check tests
func RunAllTests(t *testing.T, client ClientInterface) {
t.Run("RunAllTests", func(t *testing.T) {
t.Run("Check", func(t *testing.T) {
t.Parallel()
testCheck(t, client)
})
})
}
or
// RunAllTests will invoke all list objects tests
func RunAllTests(t *testing.T, client ClientInterface) {
t.Run("RunAll", func(t *testing.T) {
t.Run("ListObjects", func(t *testing.T) {
t.Parallel()
testListObjects(t, client)
})
})
}

Alternatives and current workarounds

No response

Additional context

No response

@miparnisari miparnisari added the enhancement New feature or request label Feb 26, 2024
Copy link

It appears this issue has been stale for at least 14 days 🗓️. If no action is taken the maintainer team may consider closing the issue. Please reach out if you need feedback or follow up actions from the maintainer team.

@github-actions github-actions bot added the Stale label Mar 12, 2024
@jpadilla jpadilla removed the Stale label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants