Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion images/bazelbuild/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bazelbuild
# bazelbuild image

This image is used for a variety of deploy/push jobs that run in the test-infra-trusted cluster. It contains:
- two versions of bazel, to support migration from one to the other
Expand Down
15 changes: 15 additions & 0 deletions images/gcb-docker-gcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# gcb-docker-gcloud image

This image is available for Google Cloud Build jobs that want to use a
combination of `docker`, `gcloud`, and `go` all in the same build step

## contents

- base:
- golang:1.16.2-alpine
- languages:
- `go`
- tools:
- `docker`
- `docker-buildx`, `qemu` binaries, `/buildx-entrypoint` for multi-arch support
- `gcloud` via rapid channel, with default components
35 changes: 28 additions & 7 deletions pkg/benchmarkjunit/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,56 @@
# benchmarkjunit
`benchmarkjunit` is a go utility that runs go [`testing` package](https://golang.org/pkg/testing/#hdr-Benchmarks) benchmarks with a command like `go test -v -bench=. <packages>` and translates the output into JUnit XML.

`benchmarkjunit` is a go utility that runs go [`testing` package benchmarks]
with a command like `go test -v -bench=. <packages>` and translates the output
into JUnit XML.

## Usage Examples

Run `go run ./pkg/benchmarkjunit --help` to see all the available flags.

```shell
go run ./pkg/benchmarkjunit k8s.io/test-infra/experiment/dummybenchmarks
```

```shell
go run ./pkg/benchmarkjunit ./experiment/dummybenchmarks/...
```

```shell
go run ./pkg/benchmarkjunit \
-o junit_benchmark.xml -l testlog.txt \
--test-arg=-benchmem --bench=Core --pass-on-error \
./experiment/dummybenchmarks/...
```

With bazel:
```shell
bazel run //pkg/benchmarkjunit -- k8s.io/test-infra/experiment/dummybenchmarks
```

### Running as a ProwJob
`benchmarkjunit` can be used from a ProwJob to generate JUnit results for consumption in Testgrid, Spyglass, Gubernator, etc. See the [`prowjob_example.yaml`](/pkg/benchmarkjunit/prowjob_example.yaml) file.

`benchmarkjunit` can be used from a ProwJob to generate JUnit results for
consumption in Testgrid, Spyglass, Gubernator, etc. See the
[`prowjob_example.yaml`](/pkg/benchmarkjunit/prowjob_example.yaml) file.

### Demo Job
The [`ci-test-infra-benchmark-demo`](https://github.com/kubernetes/test-infra/blob/1423204f375ee7cf99f2a8a61a213562039b2ac7/config/jobs/kubernetes/test-infra/test-infra-canaries.yaml#L33-L51) periodic ProwJob provides a live example of how to use `benchmarkjunit` and what the results look like. Examples:
[Testgrid](https://testgrid.k8s.io/sig-testing-canaries#benchmark-demo&width=20&graph-metrics=avg%20op%20duration%20(ns%2Fop)&graph-metrics=test-duration-minutes&graph-metrics=op%20count&graph-metrics=MB%2Fs&graph-metrics=alloced%20B%2Fop&graph-metrics=allocs%2Fop),
[Spyglass](https://prow.k8s.io/view/gcs/kubernetes-jenkins/logs/ci-test-infra-benchmark-demo/1124364619008184320),
[Raw results](https://gcsweb.k8s.io/gcs/kubernetes-jenkins/logs/ci-test-infra-benchmark-demo/1124364619008184320/artifacts/).

The [`ci-test-infra-benchmark-demo`] periodic ProwJob provides a live example
of how to use `benchmarkjunit` and what the results look like. Examples:
- [Testgrid](https://testgrid.k8s.io/sig-testing-canaries#benchmark-demo&width=20&graph-metrics=avg%20op%20duration%20(ns%2Fop)&graph-metrics=test-duration-minutes&graph-metrics=op%20count&graph-metrics=MB%2Fs&graph-metrics=alloced%20B%2Fop&graph-metrics=allocs%2Fop),
- [Spyglass](https://prow.k8s.io/view/gcs/kubernetes-jenkins/logs/ci-test-infra-benchmark-demo/1124364619008184320),
- [Raw results](https://gcsweb.k8s.io/gcs/kubernetes-jenkins/logs/ci-test-infra-benchmark-demo/1124364619008184320/artifacts/).

## Translation Example:
The following is the `go test` benchmark output and the corresponding JUnit XML for the [`experiment/dummybenchmarks`](/experiment/dummybenchmarks) package. This was generated by running `go run ./pkg/benchmarkjunit ./experiment/dummybenchmarks -l testlog.txt`.

The following is the `go test` benchmark output and the corresponding JUnit XML
for the [`experiment/dummybenchmarks`](/experiment/dummybenchmarks) package.
This was generated by running
`go run ./pkg/benchmarkjunit ./experiment/dummybenchmarks -l testlog.txt`.

#### Benchmark output:

```
goos: linux
goarch: amd64
Expand Down Expand Up @@ -76,6 +93,7 @@ FAIL k8s.io/test-infra/experiment/dummybenchmarks 25.419s
```

#### JUnit XML:

```xml
<testsuites>
<testsuite name="k8s.io/test-infra/experiment/dummybenchmarks" time="25.419" failures="3" tests="20">
Expand Down Expand Up @@ -213,3 +231,6 @@ FAIL k8s.io/test-infra/experiment/dummybenchmarks 25.419s
</testsuites>
```

<!-- links -->
[`testing` package benchmarks]: https://golang.org/pkg/testing/#hdr-Benchmarks
[`ci-test-infra-benchmark-demo`]: https://github.com/kubernetes/test-infra/blob/1423204f375ee7cf99f2a8a61a213562039b2ac7/config/jobs/kubernetes/test-infra/test-infra-canaries.yaml#L33-L51