feat: initial commit
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good

This commit is contained in:
2023-04-24 20:52:12 +02:00
commit ac21629d28
90 changed files with 5730 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package testsuite
import (
"testing"
"forge.cadoles.com/cadoles/bouncer/internal/datastore"
)
func TestProxyRepository(t *testing.T, repo datastore.ProxyRepository) {
t.Run("Cases", func(t *testing.T) {
t.Parallel()
runProxyRepositoryTests(t, repo)
})
}

View File

@ -0,0 +1,46 @@
package testsuite
import (
"context"
"testing"
"forge.cadoles.com/cadoles/bouncer/internal/datastore"
"github.com/pkg/errors"
)
type proxyRepositoryTestCase struct {
Name string
Skip bool
Run func(ctx context.Context, repo datastore.ProxyRepository) error
}
var proxyRepositoryTestCases = []proxyRepositoryTestCase{
{
Name: "Create a new agent",
Run: func(ctx context.Context, repo datastore.ProxyRepository) error {
return nil
},
},
}
func runProxyRepositoryTests(t *testing.T, repo datastore.ProxyRepository) {
for _, tc := range proxyRepositoryTestCases {
func(tc proxyRepositoryTestCase) {
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
if tc.Skip {
t.SkipNow()
return
}
ctx := context.Background()
if err := tc.Run(ctx, repo); err != nil {
t.Errorf("%+v", errors.WithStack(err))
}
})
}(tc)
}
}