-
Notifications
You must be signed in to change notification settings - Fork 442
Windows upstream e2e #1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows upstream e2e #1119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,6 +298,11 @@ spec: | |
New-HnsNetwork -Type Overlay -AddressPrefix "192.168.255.0/30" -Gateway "192.168.255.1" -Name "External" -AdapterName "Ethernet 2" -SubnetPolicies @(@{Type = "VSID"; VSID = 9999; }) | ||
path: C:/create-external-network.ps1 | ||
permissions: "0744" | ||
- content: | | ||
# /tmp is assumed created and required for upstream e2e tests to pass | ||
New-Item -ItemType Directory -Force -Path C:\tmp\ | ||
path: C:/create-temp-folder.ps1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this temp folder useful for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is required for the end to end tests. It is assume to be already created on the machines for several of the tests. I swear I left a comment here but it looks like it might have been dropped during a rebase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a comment |
||
permissions: "0744" | ||
joinConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
|
@@ -310,6 +315,7 @@ spec: | |
- nssm set kubelet start SERVICE_AUTO_START | ||
preKubeadmCommands: | ||
- powershell c:/create-external-network.ps1 | ||
- powershell C:/create-temp-folder.ps1 | ||
users: | ||
- groups: Administrators | ||
name: capi | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- op: add | ||
path: /spec/files/- | ||
value: | ||
content: | | ||
# /tmp is assumed created and required for upstream e2e tests to pass | ||
New-Item -ItemType Directory -Force -Path C:\tmp\ | ||
path: C:/create-temp-folder.ps1 | ||
permissions: "0744" | ||
- op: add | ||
path: /spec/preKubeadmCommands/- | ||
value: | ||
powershell C:/create-temp-folder.ps1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- op: add | ||
path: /spec/template/spec/files/- | ||
value: | ||
content: | | ||
# /tmp is assumed created and required for upstream e2e tests to pass | ||
New-Item -ItemType Directory -Force -Path C:\tmp\ | ||
path: C:/create-temp-folder.ps1 | ||
permissions: "0744" | ||
- op: add | ||
path: /spec/template/spec/preKubeadmCommands/- | ||
value: | ||
powershell C:/create-temp-folder.ps1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,11 @@ import ( | |
"os" | ||
"path/filepath" | ||
"strconv" | ||
"strings" | ||
|
||
"sigs.k8s.io/cluster-api-provider-azure/test/e2e/kubernetes/node" | ||
|
||
jsturtevant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
@@ -75,18 +80,28 @@ var _ = Describe("Conformance Tests", func() { | |
|
||
kubernetesVersion := e2eConfig.GetVariable(capi_e2e.KubernetesVersion) | ||
flavor := clusterctl.DefaultFlavor | ||
if isWindows(kubetestConfigFilePath) { | ||
flavor = "windows" | ||
} | ||
|
||
// clusters with CI artifacts or PR artifacts are based on a known CI version | ||
// PR artifacts will replace the CI artifacts during kubeadm init | ||
if useCIArtifacts || usePRArtifacts { | ||
kubernetesVersion, err = resolveCIVersion(kubernetesVersion) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(os.Setenv("CI_VERSION", kubernetesVersion)).To(Succeed()) | ||
|
||
if useCIArtifacts { | ||
flavor = "conformance-ci-artifacts" | ||
} else if usePRArtifacts { | ||
flavor = "conformance-presubmit-artifacts" | ||
} | ||
|
||
if isWindows(kubetestConfigFilePath) { | ||
flavor = flavor + "-windows" | ||
} | ||
Comment on lines
+100
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this PR touches this logic. Is this a placeholder for a future PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
} | ||
if useCIArtifacts { | ||
flavor = "conformance-ci-artifacts" | ||
} else if usePRArtifacts { | ||
flavor = "conformance-presubmit-artifacts" | ||
} | ||
|
||
workerMachineCount, err := strconv.ParseInt(e2eConfig.GetVariable("CONFORMANCE_WORKER_MACHINE_COUNT"), 10, 64) | ||
Expect(err).NotTo(HaveOccurred()) | ||
controlPlaneMachineCount, err := strconv.ParseInt(e2eConfig.GetVariable("CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT"), 10, 64) | ||
|
@@ -118,19 +133,37 @@ var _ = Describe("Conformance Tests", func() { | |
b.RecordValue("cluster creation", runtime.Seconds()) | ||
workloadProxy := bootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, clusterName) | ||
|
||
// Windows requires a taint on control nodes nodes since not all conformance tests have ability to run | ||
if isWindows(kubetestConfigFilePath) { | ||
options := v1.ListOptions{ | ||
LabelSelector: "kubernetes.io/os=linux", | ||
} | ||
|
||
noScheduleTaint := &corev1.Taint{ | ||
Key: "node-role.kubernetes.io/master", | ||
Value: "", | ||
Effect: "NoSchedule", | ||
} | ||
|
||
err := node.TaintNode(workloadProxy.GetClientSet(), options, noScheduleTaint) | ||
Expect(err).NotTo(HaveOccurred()) | ||
} | ||
|
||
ginkgoNodes, err := strconv.Atoi(e2eConfig.GetVariable("CONFORMANCE_NODES")) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
runtime = b.Time("conformance suite", func() { | ||
kubetest.Run(context.Background(), | ||
err := kubetest.Run(context.Background(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. Might fix kubernetes/kubernetes#101434 (comment) |
||
kubetest.RunInput{ | ||
ClusterProxy: workloadProxy, | ||
NumberOfNodes: int(workerMachineCount), | ||
ConfigFilePath: kubetestConfigFilePath, | ||
ConformanceImage: e2eConfig.GetVariable("CONFORMANCE_IMAGE"), | ||
GinkgoNodes: ginkgoNodes, | ||
ClusterProxy: workloadProxy, | ||
NumberOfNodes: int(workerMachineCount), | ||
ConfigFilePath: kubetestConfigFilePath, | ||
KubeTestRepoListPath: kubetestRepoListPath, | ||
ConformanceImage: e2eConfig.GetVariable("CONFORMANCE_IMAGE"), | ||
GinkgoNodes: ginkgoNodes, | ||
}, | ||
) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
b.RecordValue("conformance suite run time", runtime.Seconds()) | ||
}, 1) | ||
|
@@ -144,3 +177,7 @@ var _ = Describe("Conformance Tests", func() { | |
}) | ||
|
||
}) | ||
|
||
func isWindows(kubetestConfigFilePath string) bool { | ||
return strings.Contains(kubetestConfigFilePath, "windows") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
gcAuthenticatedRegistry: e2eprivate | ||
gcEtcdRegistry: k8sprow.azurecr.io/kubernetes-e2e-test-images | ||
privateRegistry: e2eteam | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new line nit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was directly pulled during I checked it in here for an example file and so it was standalone. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ginkgo.focus: \[Conformance\]|\[NodeConformance\]|\[sig-windows\]|\[sig-apps\].CronJob|\[sig-api-machinery\].ResourceQuota|\[sig-scheduling\].SchedulerPreemption | ||
ginkgo.skip: \[LinuxOnly\]|\[Serial\]|Guestbook.application.should.create.and.stop.a.working.application|device.plugin.for.Windows|Container.Lifecycle.Hook.when.create.a.pod.with.lifecycle.hook.should.execute(.*)http.hook.properly | ||
disable-log-dump: true | ||
ginkgo.progress: true | ||
ginkgo.slowSpecThreshold: 120.0 | ||
ginkgo.flakeAttempts: 0 | ||
ginkgo.trace: true | ||
ginkgo.v: true | ||
node-os-distro: windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: what do you think about
make test-conformance-windows
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I named it this way since there is no official "Conformance" for windows. We run a good set of conformance test but not all and additional Windows tests.
kubernetes/kubernetes#96639 for more info on where we are with Conformance for Windows