e2e

package
v1.145.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright 2025 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

http://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.

Index

Constants

View Source
const PlaceholderTimestamp = "2024-04-01T12:34:56.123456Z"

Variables

This section is empty.

Functions

func IgnoreAnnotations added in v1.117.0

func IgnoreAnnotations(annotations map[string]struct{}) func(string) string

func IgnoreComments

func IgnoreComments(s string) string

IgnoreComments is a normalization function that strips comments.

func LegacyNormalize added in v1.132.0

func LegacyNormalize(t *testing.T, h *create.Harness, project testgcp.GCPProject, uniqueID string, events test.LogEntries) (string, []func(string) string)

LegacyNormalize is the "legacy" normalization steps, we should avoid adding to this function and instead add to the per-service normalization functions. Deprecated: add functionality to the per-service normalization instead.

func NormalizeHTTPLog added in v1.118.2

func NormalizeHTTPLog(t *testing.T, events test.LogEntries, services mockgcpregistry.Normalizer, project testgcp.GCPProject, uniqueID string, folderID string, organizationID string)

func RemoveExtraEvents added in v1.122.0

func RemoveExtraEvents(events test.LogEntries) test.LogEntries

RemoveExtraEvents removes events that are not as relevant to our golden logs In particular, we remove repeated GET requests and LRO polling operations (and things that look like LROs)

func ReplaceString

func ReplaceString(from, to string) func(string) string

ReplaceString is a normalization function that replaces a string, useful for e.g. project IDs.

func RewriteUserAgent added in v1.128.0

func RewriteUserAgent(events test.LogEntries) test.LogEntries

RewriteUserAgent removes volatile values from the user agent: it replaces the version with ${kccVersion}.

func ShouldTestRereconiliation added in v1.132.1

func ShouldTestRereconiliation(t *testing.T, testName string, primaryResource *unstructured.Unstructured) bool

ShouldTestRereconiliation determines if we "touch" the primary object after we have run the test. This should not cause write operations to GCP (read operations are OK) We would like eventually to turn this on for all objects, but we have to turn on the testing gradually.

Note that we also use this "ratchet" list to determine whether to use SSA for creates in unified_test.go, so new resources must pass the re-reconciliation test from the start.

Types

type Expectations added in v1.125.0

type Expectations struct {
	Location bool // location or region
}
type GCPLink struct {
	PathItems []PathItem
}
func ParseGCPLink(link string) (*GCPLink, error)

type Normalizer

type Normalizer struct {
	*Replacements
	// contains filtered or unexported fields
}

func NewNormalizer

func NewNormalizer(uniqueID string, project testgcp.GCPProject) *Normalizer

func (*Normalizer) Preprocess

func (x *Normalizer) Preprocess(events []*test.LogEntry)

func (*Normalizer) Render

func (x *Normalizer) Render(events test.LogEntries) string

type PathItem added in v1.125.0

type PathItem struct {
	Resource string
	Name     string
}

type Replacements added in v1.122.0

type Replacements struct {
	PathIDs      map[string]string
	OperationIDs map[string]bool
}

Replacements manages replacements of dynamic values, like resource IDs

func NewReplacements added in v1.122.0

func NewReplacements() *Replacements

NewReplacements is a constructor for Replacements

func (*Replacements) ApplyReplacements added in v1.122.0

func (r *Replacements) ApplyReplacements(s string) string

func (*Replacements) ApplyReplacementsToHTTPEvents added in v1.122.0

func (r *Replacements) ApplyReplacementsToHTTPEvents(events test.LogEntries)
func (r *Replacements) ExtractIDsFromLinks(link string)

ExtractIDsFromLinks parses the URL or partial URL, and extracts generated IDs from it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL