This document describes the end-to-end flow of the HyperShift v2 e2e test framework, from CI job trigger through test execution and teardown. It covers process boundaries, inter-process communication, and the sequencing of mutually exclusive tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| choice=$(oc get --namespace openshift-etcd --selector etcd pods -o json | jq -r '.items[] | .spec.nodeName + " " + (.status.containerStatuses[] | select(.name=="etcd") | .containerID[8:])' | fzf) | |
| IFS=' ' read node container_id <<< "$choice" | |
| pid=$(oc debug --quiet nodes/$node -- chroot /host crictl inspect -o go-template --template '{{.info.pid}}' $container_id) | |
| oc debug --quiet nodes/$node -- chroot /host strace -Tfe inject=fdatasync:delay_enter=800000 -e trace=fdatasync -p $pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| function log { | |
| local msg="$1" | |
| echo -e "$\033[32m$(date +'%Y-%m-%d %H:%M:%S') $1 $\033[0;39m" | |
| } | |
| export KUBECONFIG=$(find $HOME/clusters -name kubeconfig | fzf) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'uri' | |
| require 'optparse' | |
| def process_gcp(dir) | |
| puts "processing gcp artifacts" | |
| `mv #{dir}/artifacts/e2e-gcp #{dir}/artifacts/must-gather` if Dir.exist?("#{dir}/artifacts/e2e-gcp") | |
| `mv #{dir}/artifacts/e2e-gcp-upgrade #{dir}/artifacts/must-gather` if Dir.exist?("#{dir}/artifacts/e2e-gcp-upgrade") | |
| `tar xf #{dir}/artifacts/must-gather/must-gather.tar -C #{dir}/artifacts/must-gather --strip-components 2` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| NAMESPACE=$1 | |
| NAME=$2 | |
| IMAGE="${IMAGE:-quay.io/dmace/ditm}" | |
| NODE_NAME="$(oc get --namespace $NAMESPACE pods $NAME -o go-template='{{ .spec.nodeName }}')" | |
| CONTAINER_ID_URI="$(oc get --namespace $NAMESPACE pods $NAME -o go-template='{{ (index .status.containerStatuses 0).containerID }}')" | |
| CONTAINER_ID="${CONTAINER_ID_URI:8}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'json' | |
| require 'yaml' | |
| require 'securerandom' | |
| require 'etc' | |
| require 'optparse' | |
| require 'fileutils' | |
| require 'tmpdir' |
Requires the following patches to get started:
-
Pull the patch manually into the installer:
git remote add jhixson74 https://github.com/jhixson74/installer.git git cherry-pick 11a381308dc2cfb21fcdaf97cc50fc42fd50b1eb
This presumably fixes some flakiness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is the project settings.json in the .vscode directory | |
| { | |
| "files.exclude": { | |
| "staging": true, | |
| }, | |
| "go.goroot": "/Users/dmace/.go/1.13.8", | |
| "go.gopath": "/Users/dmace/Projects/kubernetes", | |
| "go.toolsEnvVars": { | |
| "GO111MODULE": "off", | |
| "GOFLAGS": "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:1.13.5-buster | |
| COPY main.go /go/reaper.go | |
| RUN go build -o /bin/reaper /go/reaper.go | |
| ENTRYPOINT ["/bin/reaper"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stop := make(chan struct{}) | |
| go func() { | |
| <-signals.SetupSignalHandler() | |
| stop <- struct{}{} | |
| }() | |
| file := "/wherever" | |
| go func() { | |
| watcher, _ := fsnotify.NewWatcher() |
NewerOlder