more e2e tests (#1845)

This commit is contained in:
fatedier
2020-09-07 14:57:23 +08:00
committed by GitHub
parent 268afb3438
commit c9fe23eb10
21 changed files with 617 additions and 51 deletions

View File

@@ -4,12 +4,15 @@ import (
"flag"
"fmt"
"os"
"github.com/onsi/ginkgo/config"
)
type TestContextType struct {
FRPClientPath string
FRPServerPath string
LogLevel string
Debug bool
}
var TestContext TestContextType
@@ -23,9 +26,16 @@ var TestContext TestContextType
// regardless whether the test is actually in the test suite.
//
func RegisterCommonFlags(flags *flag.FlagSet) {
// Turn on EmitSpecProgress to get spec progress (especially on interrupt)
config.GinkgoConfig.EmitSpecProgress = true
// Randomize specs as well as suites
config.GinkgoConfig.RandomizeAllSpecs = true
flags.StringVar(&TestContext.FRPClientPath, "frpc-path", "../../bin/frpc", "The frp client binary to use.")
flags.StringVar(&TestContext.FRPServerPath, "frps-path", "../../bin/frps", "The frp server binary to use.")
flags.StringVar(&TestContext.LogLevel, "log-level", "debug", "Log level.")
flags.BoolVar(&TestContext.Debug, "debug", false, "Enable debug mode to print detail info.")
}
func ValidateTestContext(t *TestContextType) error {