Skip to content

Commit

Permalink
license: dedicated module for integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Nov 22, 2023
1 parent 73eba88 commit 8bbf3af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
1 change: 0 additions & 1 deletion internal/license/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ go_test(
name = "license_test",
srcs = [
"file_test.go",
"license_integration_test.go",
"license_test.go",
],
embed = [":license"],
Expand Down
13 changes: 13 additions & 0 deletions internal/license/integration/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("//bazel/go:go_test.bzl", "go_test")

go_test(
name = "integration_test",
srcs = ["license_integration_test.go"],
tags = [
"requires-network",
],
deps = [
"//internal/license",
"@com_github_stretchr_testify//assert",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Copyright (c) Edgeless Systems GmbH
SPDX-License-Identifier: AGPL-3.0-only
*/

package license
package integration

import (
"context"
"testing"

"github.com/edgelesssys/constellation/v2/internal/license"
"github.com/stretchr/testify/assert"
)

Expand All @@ -22,7 +23,7 @@ func TestQuotaCheckIntegration(t *testing.T) {
wantError bool
}{
"OSS license has quota 8": {
license: CommunityLicense,
license: license.CommunityLicense,
wantQuota: 8,
},
"Empty license assumes community": {
Expand All @@ -35,10 +36,10 @@ func TestQuotaCheckIntegration(t *testing.T) {
t.Run(name, func(t *testing.T) {
assert := assert.New(t)

client := NewClient()
client := license.NewClient()

req := QuotaCheckRequest{
Action: test,
req := license.QuotaCheckRequest{
Action: license.Action("test"),
License: tc.license,
}
resp, err := client.QuotaCheck(context.Background(), req)
Expand All @@ -51,4 +52,6 @@ func TestQuotaCheckIntegration(t *testing.T) {
assert.Equal(tc.wantQuota, resp.Quota)
})
}

t.Fatal("DO NOT MERGE: failing this test to verify bazelrc settings")
}

0 comments on commit 8bbf3af

Please sign in to comment.