e2e_test.go 983 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package e2e
  2. import (
  3. "flag"
  4. "fmt"
  5. "os"
  6. "testing"
  7. _ "github.com/onsi/ginkgo/v2"
  8. "github.com/fatedier/frp/pkg/util/log"
  9. // test source
  10. "github.com/fatedier/frp/test/e2e/framework"
  11. _ "github.com/fatedier/frp/test/e2e/legacy/basic"
  12. _ "github.com/fatedier/frp/test/e2e/legacy/features"
  13. _ "github.com/fatedier/frp/test/e2e/legacy/plugin"
  14. _ "github.com/fatedier/frp/test/e2e/v1/basic"
  15. _ "github.com/fatedier/frp/test/e2e/v1/features"
  16. _ "github.com/fatedier/frp/test/e2e/v1/plugin"
  17. )
  18. // handleFlags sets up all flags and parses the command line.
  19. func handleFlags() {
  20. framework.RegisterCommonFlags(flag.CommandLine)
  21. flag.Parse()
  22. }
  23. func TestMain(m *testing.M) {
  24. // Register test flags, then parse flags.
  25. handleFlags()
  26. if err := framework.ValidateTestContext(&framework.TestContext); err != nil {
  27. fmt.Println(err)
  28. os.Exit(1)
  29. }
  30. log.InitLogger("console", framework.TestContext.LogLevel, 0, true)
  31. os.Exit(m.Run())
  32. }
  33. func TestE2E(t *testing.T) {
  34. RunE2ETests(t)
  35. }