-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: allow go test ./... to run without errors
Ensure `go test ./...` runs without errors out-of-the-box. To this end, we guard the acceptance tests behind a skip tag because they require a special setup and are not meant to be run as regular unit tests. We also add stub packages for the linter tests.
- Loading branch information
Showing
7 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023 Anapaya Systems | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Package slog is a stub for testing | ||
package slog | ||
|
||
func Debug(string, ...any) {} | ||
func Info(string, ...any) {} | ||
func Error(string, ...any) {} |
1 change: 0 additions & 1 deletion
1
tools/lint/logctxcheck/testdata/src/github.com/scionproto/scion/pkg/log
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
tools/lint/logctxcheck/testdata/src/github.com/scionproto/scion/pkg/log/log.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2023 Anapaya Systems | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Package log is a stub for the actual log package. It allows the logctxcheck | ||
// analyzer tests to run. | ||
package log | ||
|
||
import "context" | ||
|
||
func Debug(string, ...any) {} | ||
func Info(string, ...any) {} | ||
func Error(string, ...any) {} | ||
func New(...any) Logger { return nil } | ||
func FromCtx(context.Context) Logger { return nil } | ||
func Root() Logger { return nil } | ||
|
||
type Logger interface { | ||
Debug(string, ...any) | ||
Info(string, ...any) | ||
Error(string, ...any) | ||
} |
19 changes: 19 additions & 0 deletions
19
tools/lint/serrorscheck/testdata/src/fake/serrors/serrors.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2023 Anapaya Systems | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Package serrors is a stub for testing | ||
package serrors | ||
|
||
func New(string, ...any) error { return nil } | ||
func Wrap(error, error, ...any) error { return nil } |
22 changes: 22 additions & 0 deletions
22
...lint/serrorscheck/testdata/src/github.com/scionproto/scion/pkg/private/serrors/serrors.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2023 Anapaya Systems | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Package serrors is a stub for the actual serrors package. It allows the | ||
// serrorscheck analyzer tests to run. | ||
package serrors | ||
|
||
func New(string, ...any) error { return nil } | ||
func Wrap(error, error, ...any) error { return nil } | ||
func WrapStr(error, string, ...any) error { return nil } | ||
func WithCtx(error, ...any) error { return nil } |