You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-08-10 22:31:50 +02:00
Replace tenv with usetesting (#6313)
The `tenv` linter is deprecated in favor of `usetesting`.
This commit is contained in:
@@ -25,13 +25,13 @@ linters:
|
|||||||
- perfsprint
|
- perfsprint
|
||||||
- revive
|
- revive
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- tenv
|
|
||||||
- testifylint
|
- testifylint
|
||||||
- typecheck
|
- typecheck
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
- unused
|
||||||
- unparam
|
- unparam
|
||||||
- usestdlibvars
|
- usestdlibvars
|
||||||
|
- usetesting
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# Maximum issues count per one linter.
|
# Maximum issues count per one linter.
|
||||||
|
@@ -15,7 +15,7 @@ import (
|
|||||||
func TestReadFileExistent(t *testing.T) {
|
func TestReadFileExistent(t *testing.T) {
|
||||||
fileContents := "foo"
|
fileContents := "foo"
|
||||||
|
|
||||||
f, err := os.CreateTemp("", "readfile_")
|
f, err := os.CreateTemp(t.TempDir(), "readfile_")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
defer os.Remove(f.Name())
|
defer os.Remove(f.Name())
|
||||||
@@ -31,7 +31,7 @@ func TestReadFileExistent(t *testing.T) {
|
|||||||
|
|
||||||
func TestReadFileNonExistent(t *testing.T) {
|
func TestReadFileNonExistent(t *testing.T) {
|
||||||
// create unique filename
|
// create unique filename
|
||||||
f, err := os.CreateTemp("", "readfile_")
|
f, err := os.CreateTemp(t.TempDir(), "readfile_")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// make file non-existent
|
// make file non-existent
|
||||||
|
@@ -8,7 +8,6 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -267,7 +266,7 @@ func TestNewBatchSpanProcessorWithEnvOptions(t *testing.T) {
|
|||||||
for _, option := range options {
|
for _, option := range options {
|
||||||
t.Run(option.name, func(t *testing.T) {
|
t.Run(option.name, func(t *testing.T) {
|
||||||
for k, v := range option.envs {
|
for k, v := range option.envs {
|
||||||
require.NoError(t, os.Setenv(k, v))
|
t.Setenv(k, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
te := testBatchExporter{}
|
te := testBatchExporter{}
|
||||||
|
@@ -5,7 +5,6 @@ package trace
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@@ -115,7 +114,7 @@ func TestSettingSpanLimits(t *testing.T) {
|
|||||||
t.Cleanup(func() { require.NoError(t, es.Restore()) })
|
t.Cleanup(func() { require.NoError(t, es.Restore()) })
|
||||||
for k, v := range test.env {
|
for k, v := range test.env {
|
||||||
es.Record(k)
|
es.Record(k)
|
||||||
require.NoError(t, os.Setenv(k, v))
|
t.Setenv(k, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user