Skip to content

Commit fe57bdd

Browse files
committed
From #4116 - to be rebased once merged
Signed-off-by: apostasie <[email protected]>
1 parent 7823694 commit fe57bdd

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

mod/tigron/.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ linters:
5757
settings:
5858
interfacebloat:
5959
# Default is 10
60-
max: 13
60+
max: 20
6161
revive:
6262
enable-all-rules: true
6363
rules:

mod/tigron/test/command.go

+4
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ func (gc *GenericCommand) Feed(r io.Reader) {
131131
gc.cmd.Feed(r)
132132
}
133133

134+
func (gc *GenericCommand) Setenv(key, value string) {
135+
gc.cmd.Env[key] = value
136+
}
137+
134138
func (gc *GenericCommand) WithFeeder(fun func() io.Reader) {
135139
gc.cmd.WithFeeder(fun)
136140
}

mod/tigron/test/data.go

-12
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ const (
3434
identifierSignatureLength = 8
3535
)
3636

37-
// WithFile returns a Data object with a specific temporary file created.
38-
func WithFile(name, content string) Data {
39-
dat := &data{
40-
labels: &labels{},
41-
temp: &temp{},
42-
}
43-
44-
dat.temp.Save(content, name)
45-
46-
return dat
47-
}
48-
4937
// WithLabels returns a Data object with specific key value labels set.
5038
func WithLabels(in map[string]string) Data {
5139
dat := &data{

mod/tigron/test/interfaces.go

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ type TestableCommand interface {
111111
WithCwd(path string)
112112
// WithTimeout defines the execution timeout for a command.
113113
WithTimeout(timeout time.Duration)
114+
// Setenv allows to override a specific env variable directly for a specific command instead of test-wide
115+
Setenv(key, value string)
114116
// WithFeeder allows passing a reader to be fed to the command stdin.
115117
WithFeeder(fun func() io.Reader)
116118
// Feed allows passing a reader to be fed to the command stdin.

0 commit comments

Comments
 (0)