mirror of https://github.com/knative/caching.git
[master] Auto-update dependencies (#241)
Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov
This commit is contained in:
parent
4a8e88e295
commit
da7a156ad6
|
@ -966,7 +966,7 @@
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:1cfbe38d639ea8c4aeb9f1b0b98ac80b0004ef612f0b48eb572ba6bb23bdc003"
|
digest = "1:ae72dd6d2950c1ffe31061c827bb8904fce102f9134c4309cca0fe1ac5864c26"
|
||||||
name = "knative.dev/pkg"
|
name = "knative.dev/pkg"
|
||||||
packages = [
|
packages = [
|
||||||
"apis",
|
"apis",
|
||||||
|
@ -986,7 +986,7 @@
|
||||||
"reconciler",
|
"reconciler",
|
||||||
]
|
]
|
||||||
pruneopts = "T"
|
pruneopts = "T"
|
||||||
revision = "94b2b6aaaf4b81c3b26b269bd477518094aa31a5"
|
revision = "55250e6aab62f767b8680a12ddeb771c519d78fe"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
@ -997,7 +997,7 @@
|
||||||
"tools/dep-collector",
|
"tools/dep-collector",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "5bdfbd623938f0cc4a260bf06c503bbb0a76d6f9"
|
revision = "163337c1d67d883a84d10c4e769e6fc493649341"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
||||||
|
|
|
@ -1362,14 +1362,14 @@
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:41da78d06d64a1eb47a1d3f8209d33af386fa8f22d1b04b25825ae5cd187be1d"
|
digest = "1:5da0f15efcd7dafa6296be9cd4a630fcb5253cf202e54638299221ae7df419ab"
|
||||||
name = "knative.dev/test-infra"
|
name = "knative.dev/test-infra"
|
||||||
packages = [
|
packages = [
|
||||||
"scripts",
|
"scripts",
|
||||||
"tools/dep-collector",
|
"tools/dep-collector",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "030e4e29cb8ba9502a06b667b1450f6a725371b1"
|
revision = "5bdfbd623938f0cc4a260bf06c503bbb0a76d6f9"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Knative 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 helpers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
const allUsersFullPermission = 0777
|
||||||
|
|
||||||
|
// CreateDir creates dir if does not exist.
|
||||||
|
// The created dir will have the permission bits as 0777, which means everyone can read/write/execute it.
|
||||||
|
func CreateDir(dirPath string) error {
|
||||||
|
return CreateDirWithFileMode(dirPath, allUsersFullPermission)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateDirWithFileMode creates dir if does not exist.
|
||||||
|
// The created dir will have the permission bits as perm, which is the standard Unix rwxrwxrwx permissions.
|
||||||
|
func CreateDirWithFileMode(dirPath string, perm os.FileMode) error {
|
||||||
|
if _, err := os.Stat(dirPath); os.IsNotExist(err) {
|
||||||
|
if err = os.MkdirAll(dirPath, perm); err != nil {
|
||||||
|
return fmt.Errorf("error creating directory: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRootDir gets directory of git root
|
||||||
|
func GetRootDir() (string, error) {
|
||||||
|
cmd := exec.Command("git", "rev-parse", "--show-toplevel")
|
||||||
|
output, err := cmd.Output()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return strings.TrimSpace(string(output)), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ChdirToRoot change directory to git root dir
|
||||||
|
func ChdirToRoot() error {
|
||||||
|
d, err := GetRootDir()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return os.Chdir(d)
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Knative 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 performance
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"knative.dev/pkg/test/junit"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Property name of the performance test, it's used by testgrid for visualization
|
||||||
|
perfPropertyName = "perf_latency"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CreatePerfTestCase creates a perf test case with the provided name and value
|
||||||
|
func CreatePerfTestCase(metricValue float32, metricName, testName string) junit.TestCase {
|
||||||
|
tp := []junit.TestProperty{{Name: perfPropertyName, Value: fmt.Sprintf("%f", metricValue)}}
|
||||||
|
tc := junit.TestCase{
|
||||||
|
ClassName: testName,
|
||||||
|
Name: fmt.Sprintf("%s/%s", testName, metricName),
|
||||||
|
Properties: junit.TestProperties{Properties: tp}}
|
||||||
|
|
||||||
|
return tc
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Knative 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// testgrid.go provides methods to perform action on testgrid.
|
||||||
|
|
||||||
|
package testgrid
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"path"
|
||||||
|
|
||||||
|
"knative.dev/pkg/test/helpers"
|
||||||
|
"knative.dev/pkg/test/junit"
|
||||||
|
"knative.dev/pkg/test/prow"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
filePrefix = "junit_"
|
||||||
|
extension = ".xml"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CreateXMLOutput creates the junit xml file in the provided artifacts directory
|
||||||
|
func CreateXMLOutput(tc []junit.TestCase, testName string) error {
|
||||||
|
ts := junit.TestSuites{}
|
||||||
|
ts.AddTestSuite(&junit.TestSuite{Name: testName, TestCases: tc})
|
||||||
|
|
||||||
|
// ensure artifactsDir exist, in case not invoked from this script
|
||||||
|
artifactsDir := prow.GetLocalArtifactsDir()
|
||||||
|
if err := helpers.CreateDir(artifactsDir); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
op, err := ts.ToBytes("", " ")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
outputFile := path.Join(artifactsDir, filePrefix+testName+extension)
|
||||||
|
log.Printf("Storing output in %s", outputFile)
|
||||||
|
f, err := os.OpenFile(outputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
|
defer f.Close()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := f.WriteString(string(op) + "\n"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
Loading…
Reference in New Issue