Spinning up services for tests is one of the slower pieces of writing a test. Wherever possible, keep this setup in your suite's Setup to avoid long test times.
var (| #/usr/bin/env python | |
| import re | |
| def parse_fk(fk_str): | |
| res = re.search("foreign key \(([^\)]+)\) references ([^ ]+) \(([^\)]+)\)", fk_str) | |
| return res.group(1), res.group(2), res.group(3) | |
| #!/usr/bin/env python | |
| from PIL import Image | |
| image = Image.open("base.png") | |
| def is_empty(line): | |
| for x in range(line.width): | |
| r, g, b, a = line.getpixel((x, 0)) | |
| if r + g + b + a > 0: |
| # triggers a new "b" pod to be created | |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: b | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: |
| # scales deployment a to 500 replicas | |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: a | |
| spec: | |
| replicas: 500 | |
| selector: | |
| matchLabels: |
| # sets up a, b, c deployments with services for a and b | |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: a | |
| labels: | |
| app: a | |
| spec: | |
| ports: |
| package main | |
| import ( | |
| "fmt" | |
| "encoding/json" | |
| "istio.io/istio/pkg/kube" | |
| "k8s.io/apimachinery/pkg/runtime" | |
| ) |
This page introduces the Istio test framework. For an overview of the architecture as well as how to extend the framework, see the Developer Guide.
| #!/bin/bash | |
| set -e | |
| set -u | |
| set -o pipefail | |
| SERVICE="vm" | |
| NAMESPACE="echo" | |
| NETWORK="" | |
| CLUSTER="Kubernetes" |
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| "go.uber.org/atomic" | |
| "istio.io/istio/pkg/config/schema/collections" | |
| kubelib "istio.io/istio/pkg/kube" |