onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.33k stars 658 forks source link

feat(ginkgo/generators): add --tags flag #1216

Closed alegrey91 closed 1 year ago

alegrey91 commented 1 year ago

This PR adds a new flag --tags under the ginkgo generate command. This flag allows the user to add the build tags that he needs for the tests.

Closes #1213

Example command:

ginkgo generate -tags "unit || e2e" test

This will generate the following file:

//go:build unit || e2e

package main_test

import (
    . "github.com/onsi/ginkgo/v2"
    . "github.com/onsi/gomega"

    "github.com/onsi/ginkgo/v2/ginkgo"
)

var _ = Describe("Test", func() {

})
onsi commented 1 year ago

sorry for the delay - i was out on vacation! running this now.