Skip to content

Commit 3b06dc9

Browse files
author
Evan Anderson
authored
Disable failing integration tests (knative#4300)
* Disable integration tests because they break a lot, per julz * Actually run go and notice extra unused imports * Revert "Disable integration tests because they break a lot, per julz" I took out too much. This reverts commit eca3a2d. * Re-add simplifed sampleapp used by the consistency checker * Forgot to autoformat after beating things with emacs and grep * Add empty e2e tests * Fix formatting again. `vi` this time
1 parent d2f9187 commit 3b06dc9

File tree

6 files changed

+9
-335
lines changed

6 files changed

+9
-335
lines changed

test/e2e/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package e2etest
17+
// Temporarily have an empty package here until we remove the prow jobs
18+
// https://github.com/knative/test-infra/pull/2891
19+
package e2e

test/e2e/sampleapp_test.go

-50
This file was deleted.

test/e2e/sampleapptestbase.go

-197
This file was deleted.

test/flag.go

+1-27
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ package test
1818

1919
import (
2020
"flag"
21-
"fmt"
22-
"os"
2321
"strings"
2422
)
2523

@@ -29,40 +27,16 @@ var Flags = initializeFlags()
2927

3028
// EnvironmentFlags define the flags that are needed to run the e2e tests.
3129
type EnvironmentFlags struct {
32-
Cluster string // K8s cluster (defaults to cluster in kubeconfig)
33-
LogVerbose bool // Enable verbose logging
34-
DockerRepo string // Docker repo (defaults to $KO_DOCKER_REPO)
35-
EmitMetrics bool // Emit metrics
36-
Tag string // Docker image tag
37-
Languages string // Allowed languages to run
30+
Languages string // Allowed languages to run
3831
}
3932

4033
func initializeFlags() *EnvironmentFlags {
4134
var f EnvironmentFlags
42-
flag.StringVar(&f.Cluster, "cluster", "",
43-
"Provide the cluster to test against. Defaults to the current cluster in kubeconfig.")
44-
45-
flag.BoolVar(&f.LogVerbose, "logverbose", false,
46-
"Set this flag to true if you would like to see verbose logging.")
47-
48-
flag.BoolVar(&f.EmitMetrics, "emitmetrics", false,
49-
"Set this flag to true if you would like tests to emit metrics, e.g. latency of resources being realized in the system.")
50-
51-
flag.StringVar(&f.DockerRepo, "dockerrepo", os.Getenv("KO_DOCKER_REPO"),
52-
"Provide the uri of the docker repo you have uploaded the test image to using `uploadtestimage.sh`. Defaults to $KO_DOCKER_REPO")
53-
54-
flag.StringVar(&f.Tag, "tag", "latest", "Provide the version tag for the test images.")
55-
5635
flag.StringVar(&f.Languages, "languages", "", "Comma separated languages to run e2e test on.")
5736

5837
return &f
5938
}
6039

61-
// ImagePath is a helper function to prefix image name with repo and suffix with tag
62-
func ImagePath(name string) string {
63-
return fmt.Sprintf("%s/%s:%s", Flags.DockerRepo, name, Flags.Tag)
64-
}
65-
6640
// GetAllowedLanguages is a helper function to return a map of allowed languages based on Languages filter
6741
func GetAllowedLanguages() map[string]bool {
6842
allowed := make(map[string]bool)

test/sampleapp/config.go

+5-40
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,13 @@ package sampleapp
1919
import (
2020
"fmt"
2121
"io/ioutil"
22-
"os/exec"
23-
"strings"
24-
"testing"
2522

2623
yaml "gopkg.in/yaml.v2"
2724
)
2825

2926
const (
3027
// using these defaults if not provided, see useDefaultIfNotProvided function below
31-
defaultSrcDir = "../../docs/serving/samples/hello-world/helloworld-%s"
32-
defaultWorkDir = "helloworld-%s_tmp"
33-
defaultAppName = "helloworld-%s"
34-
defaultYamlImagePlaceHolder = "docker.io/{username}/helloworld-%s"
28+
defaultSrcDir = "../../docs/serving/samples/hello-world/helloworld-%s"
3529

3630
// ActionMsg serves as documentation purpose, which will be referenced for
3731
// clearly displaying error messages.
@@ -51,45 +45,16 @@ type AllConfigs struct {
5145

5246
// LanguageConfig contains all information for building/deploying an app
5347
type LanguageConfig struct {
54-
Language string `yaml:"language"`
55-
ExpectedOutput string `yaml:"expectedOutput"`
56-
SrcDir string `yaml:"srcDir"` // Directory contains sample code
57-
WorkDir string `yaml:"workDir"` // Temp work directory
58-
AppName string `yaml:"appName"`
59-
YamlImagePlaceholder string `yaml:"yamlImagePlaceholder"` // Token to be replaced by real docker image URI
60-
PreCommands []Command `yaml:"preCommands"` // Commands to be ran before copying
61-
Copies []string `yaml:"copies"` // Files to be copied from SrcDir to WorkDir
62-
PostCommands []Command `yaml:"postCommands"` // Commands to be ran after copying
48+
Language string `yaml:"language"`
49+
SrcDir string `yaml:"srcDir"` // Directory contains sample code
50+
Copies []string `yaml:"copies"` // Files to be copied by the user from SrcDir
6351
}
6452

65-
// Command contains shell commands
66-
type Command struct {
67-
Exec string `yaml:"exec"`
68-
Args string `yaml:"args"`
69-
}
70-
71-
// UseDefaultIfNotProvided sets default value to SrcDir, WorkDir, AppName, and YamlImagePlaceholder if not provided
53+
// UseDefaultIfNotProvided sets default value of SrcDir if not provided
7254
func (lc *LanguageConfig) UseDefaultIfNotProvided() {
7355
if "" == lc.SrcDir {
7456
lc.SrcDir = fmt.Sprintf(defaultSrcDir, lc.Language)
7557
}
76-
if "" == lc.WorkDir {
77-
lc.WorkDir = fmt.Sprintf(defaultWorkDir, lc.Language)
78-
}
79-
if "" == lc.AppName {
80-
lc.AppName = fmt.Sprintf(defaultAppName, lc.Language)
81-
}
82-
if "" == lc.YamlImagePlaceholder {
83-
lc.YamlImagePlaceholder = fmt.Sprintf(defaultYamlImagePlaceHolder, lc.Language)
84-
}
85-
}
86-
87-
// Run runs command and fail if it failed
88-
func (c *Command) Run(t *testing.T) {
89-
args := strings.Split(c.Args, " ")
90-
if output, err := exec.Command(c.Exec, args...).CombinedOutput(); err != nil {
91-
t.Fatalf("Error executing: '%s' '%s' -err: '%v'", c.Exec, c.Args, strings.TrimSpace(string(output)))
92-
}
9358
}
9459

9560
// GetConfigs parses a config yaml file and return AllConfigs struct

0 commit comments

Comments
 (0)