Skip to content

Commit

Permalink
test(compute): remove TestCapitalLetter (#6908)
Browse files Browse the repository at this point in the history
This test has been flaky for a long time. If we want something like this test in the future I think it needs to be re-structured to be successful. For now we will remove it as it is not providing value as is and since writing there are now many tests in our samples that should cover these types of use-cases.

Fixes: #5988
  • Loading branch information
codyoss committed Oct 24, 2022
1 parent bceff0b commit c6b704a
Showing 1 changed file with 0 additions and 75 deletions.
75 changes: 0 additions & 75 deletions compute/apiv1/smoke_test.go
Expand Up @@ -27,8 +27,6 @@ import (

"google.golang.org/api/option"

"github.com/google/go-cmp/cmp"

"cloud.google.com/go/internal/testutil"
"cloud.google.com/go/internal/uid"
"google.golang.org/api/iterator"
Expand Down Expand Up @@ -434,79 +432,6 @@ func TestPaginationMapResponseMaxRes(t *testing.T) {
}
}

func TestCapitalLetter(t *testing.T) {
if testing.Short() {
t.Skip("skipping smoke test in short mode")
}
ctx := context.Background()
c, err := NewFirewallsRESTClient(ctx)
if err != nil {
t.Fatal(err)
}
space := uid.NewSpace("gogapic", nil)
name := space.New()
allowed := []*computepb.Allowed{
{
IPProtocol: proto.String("tcp"),
Ports: []string{
"80",
},
},
}
res := &computepb.Firewall{
SourceRanges: []string{
"0.0.0.0/0",
},
Name: proto.String(name),
Allowed: allowed,
}
req := &computepb.InsertFirewallRequest{
Project: projectId,
FirewallResource: res,
}
insert, err := c.Insert(ctx, req)
if err != nil {
t.Fatal(err)
}
err = insert.Wait(ctx)
if err != nil {
t.Fatal(err)
}
defer func() {
var op *Operation
var err error
ok := testutil.Retry(t, 20, 10*time.Second, func(r *testutil.R) {
var err error
op, err = c.Delete(ctx,
&computepb.DeleteFirewallRequest{
Project: projectId,
Firewall: name,
})
if err != nil {
r.Errorf("%v", err)
}
})
if !ok {
t.Fatal(err)
}
timeoutCtx, cancel := context.WithTimeout(ctx, 10*time.Minute)
defer cancel()
if err = op.Wait(timeoutCtx); err != nil {
t.Error(err)
}
}()
fetched, err := c.Get(ctx, &computepb.GetFirewallRequest{
Project: projectId,
Firewall: name,
})
if err != nil {
t.Fatal(err)
}
if diff := cmp.Diff(fetched.GetAllowed(), allowed, cmp.Comparer(proto.Equal)); diff != "" {
t.Fatalf("got(-),want(+):\n%s", diff)
}
}

func TestHeaders(t *testing.T) {
ctx := context.Background()

Expand Down

0 comments on commit c6b704a

Please sign in to comment.