-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify multiple labels when running tests #194
Comments
@embano1 thanks for the issue. Are you saying that a features cannot have multiple labels added to it? Or are you saying you just want to run multiple features with the same labels ? For the latter, you should be able to declare multiple features with the same (or different) labels and run them: func TestHello_WithSetup(t *testing.T) {
e := env.NewWithConfig(envconf.New())
var name string
f0 := features.New("Hello Feature").
WithLabel("type", "hello").
Assess("test message", func(ctx context.Context, t *testing.T, _ *envconf.Config) context.Context {
result := Hello(name)
if result != "Hello foobar" {
t.Error("unexpected message")
}
return ctx
}).Feature()
f1 := features.New("Goodbye Feature").
WithLabel("type", "message").
Assess("test message", func(ctx context.Context, t *testing.T, _ *envconf.Config) context.Context {
result := Goodbye(name)
if result != "Goodbye foobar" {
t.Error("unexpected message")
}
return ctx
}).Feature()
e.Test(t, f0, f1)
} You should be able to select each feature by label as follows:
If i completely misunderstood your question (or there is a bug), please let us know. |
Thx for your response! What I found was that if A fix would be to use [Update] |
This example recommends a label key
test
and values for individual features:e2e-framework/README.md
Lines 70 to 84 in 8e4361f
However, following this logic, I cannot run multiple features with the same label
key
, e.g.--labels="feature=feat1,feature=feat2"
is not possible (in my current tests the first one is ignored). I guess this is due to the label parsing map used:e2e-framework/pkg/flags/flags.go
Line 290 in 8e4361f
Wondering if we should fix this so I can run multiple features instead of just one when using the same label
key
.The text was updated successfully, but these errors were encountered: