diff --git a/Makefile b/Makefile index 4e67dc28f6..7d2f52759a 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ INTERFACE_ACTIONS="build test lint" export GOLANG_SAMPLES_E2E_TEST ?= true export GOLANG_SAMPLES_PROJECT_ID ?=${GOOGLE_SAMPLES_PROJECT} +# Required for cloud profiler tests to run +export GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn + build: go -C ${dir} build . diff --git a/badfiles_test.go b/badfiles_test.go index f61d503611..62e4fbb7fc 100644 --- a/badfiles_test.go +++ b/badfiles_test.go @@ -91,6 +91,9 @@ var allowList = []string{ // Cloud Functions gen2 picture. "functions/functionsv2/imagemagick/zombie.jpg", + // Cloud Profiler test outputs + "profiler/export/**", + // Samples that aren't really code. Legacy. "**/appengine/**/*.txt", diff --git a/internal/e2e/README.md b/internal/e2e/README.md deleted file mode 100644 index 740c82bd65..0000000000 --- a/internal/e2e/README.md +++ /dev/null @@ -1,16 +0,0 @@ -## Running tests - -Prerequisites: - -* Install the [Google Cloud SDK](https://cloud.google.com/sdk/). -* Install the `app` command. You can do this via: - - $ gcloud --quiet help app - -Before running tests: - - $ gcloud auth login - -Running without Docker: - - $ GOLANG_SAMPLES_E2E_TEST=1 go test -v diff --git a/internal/e2e/standard_test.go b/internal/e2e/standard_test.go deleted file mode 100644 index b2dacbf05d..0000000000 --- a/internal/e2e/standard_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package e2e contains end-to-end tests for Go programs running on Google Cloud Platform. -// See README.md for details on running the tests. -package e2e - -import ( - "io" - "log" - "strings" - "testing" - "time" - - "github.com/GoogleCloudPlatform/golang-samples/internal/aeintegrate" - "github.com/GoogleCloudPlatform/golang-samples/internal/testutil" -) - -func TestHelloWorld(t *testing.T) { - tc := testutil.EndToEndTest(t) - - helloworld := &aeintegrate.App{ - Name: "hw", - Dir: tc.Path("appengine", "go11x", "helloworld"), - ProjectID: tc.ProjectID, - } - defer helloworld.Cleanup() - - bodyShouldContain(t, helloworld, "/", "Hello, World!") -} - -func bodyShouldContain(t *testing.T, p *aeintegrate.App, path, shouldContain string) { - if p.Deployed() { - t.Fatalf("[%s] expected non-deployed app", p.Name) - } - - if err := p.Deploy(); err != nil { - t.Fatalf("could not deploy %s: %v", p.Name, err) - } - - url, _ := p.URL("") - log.Printf("(%s) Deployed to %s", p.Name, url) - - testutil.Retry(t, 20, 10*time.Second, func(r *testutil.R) { - resp, err := p.Get(path) - if err != nil { - r.Errorf("Get: %v", err) - return - } - b, err := io.ReadAll(resp.Body) - if err != nil { - r.Errorf("could not read body: %v", err) - return - } - if got := string(b); !strings.Contains(got, shouldContain) { - r.Errorf("got\n----\n%s\n----Want to contain:\n----%s\n", got, shouldContain) - } - }) -} diff --git a/securitycenter/muteconfig/mute_config_test.go b/securitycenter/muteconfig/mute_config_test.go index b06618ec40..27b79f6131 100644 --- a/securitycenter/muteconfig/mute_config_test.go +++ b/securitycenter/muteconfig/mute_config_test.go @@ -251,6 +251,7 @@ func TestSetMuteFinding(t *testing.T) { } func TestSetUnmuteFinding(t *testing.T) { + t.Skip("see https://github.com/GoogleCloudPlatform/golang-samples/issues/3793") testutil.SystemTest(t) var buf bytes.Buffer