Skip to content

Instantly share code, notes, and snippets.

@imjasonh
Created August 4, 2021 01:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save imjasonh/532c4a09680c16666a25e424b59cb94a to your computer and use it in GitHub Desktop.
Save imjasonh/532c4a09680c16666a25e424b59cb94a to your computer and use it in GitHub Desktop.
// +build e2e,windows_e2e
/*
Copyright 2021 The Tekton Authors
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.
*/
package test
import (
"context"
"fmt"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/test/helpers"
)
func TestWindows(t *testing.T) {
ctx := context.Background()
c, _ := setup(ctx, t, requireAnyGate(map[string]string{"enable-api-fields": "alpha"}))
name := helpers.ObjectNameForTest(t)
tr := mustParseTaskRun(t, fmt.Sprintf(`
metadata:
name: %q
spec:
taskSpec:
steps:
- image: some-windows-image
args: ['exit', 'successfully']
podTemplate:
nodeSelector:
kubernetes.io/os: windows`, name))
if _, err := c.TaskRunClient.Create(ctx, tr, metav1.CreateOptions{}); err != nil {
t.Fatalf("Creating TaskRun: %v", err)
}
if err := WaitForTaskRunState(ctx, c, name, Running(name), "TaskRunRunning"); err != nil {
t.Fatalf("Waiting for TaskRun to become Running: %v", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment