mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-15 04:32:15 -04:00
bazel: deps mirror (#1522)
bazel-deps-mirror is an internal tools used to upload external dependencies that are referenced in the Bazel WORKSPACE to the Edgeless Systems' mirror. It also normalizes deps rules. * hack: add tool to mirror Bazel dependencies * hack: bazel-deps-mirror tests * bazel: add deps mirror commands * ci: upload Bazel dependencies on renovate PRs * update go mod * run deps_mirror_upload Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
d3e2f30f7b
commit
827c4f548d
36 changed files with 2698 additions and 529 deletions
46
hack/bazel-deps-mirror/internal/issues/issues_test.go
Normal file
46
hack/bazel-deps-mirror/internal/issues/issues_test.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package issues
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
goleak.VerifyTestMain(m)
|
||||
}
|
||||
|
||||
func TestMap(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
m := New()
|
||||
assert.Equal(0, len(m))
|
||||
assert.False(m.FileHasIssues("file1"))
|
||||
m.Set("file1", map[string][]error{
|
||||
"rule1": {errors.New("r1_issue1"), errors.New("r1_issue2")},
|
||||
"rule2": {errors.New("r2_issue1")},
|
||||
})
|
||||
assert.Equal(3, m.IssuesPerFile("file1"))
|
||||
assert.True(m.FileHasIssues("file1"))
|
||||
|
||||
// let report write to a buffer
|
||||
b := new(bytes.Buffer)
|
||||
m.Report(b)
|
||||
rep := b.String()
|
||||
assert.Equal(rep, `File file1 (3 issues total):
|
||||
Rule rule1 (2 issues total):
|
||||
r1_issue1
|
||||
r1_issue2
|
||||
Rule rule2 (1 issues total):
|
||||
r2_issue1
|
||||
`)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue