Production-Grade Container Scheduling and Management
Go to file
Patrick Ohly 311b66ada1 e2e: unit test for logger.go and ginkgowrapper.go
This test runs a fake Ginkgo suite with various errors and checks how
logger.go respectively ginkgowrapper.go handle this. Right now, the
outcome is sub-optimal:

- some test failures (those that use framework.Failf or
  framework.ExpectNoError) are logged immediately, Gomega failures
  are not
- framework.ExpectNoError logs just the error, which is often useless
  without the additional explanation
- failures that occur after some others are not reported at all;
  this can happen in cleanup code and while that code should better
  be written so that it contines instead of failing on an assertion,
  in practice quite a lot of code fails and when it does, the output
  would be useful to have
- the full stack trace is odd and doesn't start with the expected
  function name

Example output:

• Failure [0.002 seconds]
log
/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:35
  fails [It]
  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:39

  Jul 17 12:00:52.545: I'm failing.

  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:41

  Full Stack Trace
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger.go:51 +0x143
  k8s.io/kubernetes/test/e2e/framework/log.Failf(...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger.go:43
  k8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.2.1(...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:41
  k8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.2()
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:42 +0x52
  k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc00029b020, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:65 +0x1c8
  testing.tRunner(0xc000358600, 0x19818c0)
  	/nvme/gopath/go/src/testing/testing.go:865 +0xc0
  created by testing.(*T).Run
  	/nvme/gopath/go/src/testing/testing.go:916 +0x35a

------------------------------
Jul 17 12:00:52.545: INFO: before
Jul 17 12:00:52.545: INFO: I'm failing.
Jul 17 12:00:52.547: INFO: after
• Failure [0.002 seconds]
log
/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:35
  asserts [It]
  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:44

  false is never true
  Expected
      <bool>: false
  to equal
      <bool>: true

  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:45

  Full Stack Trace
  	/nvme/gopath/src/k8s.io/kubernetes/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:75 +0x1f1
  k8s.io/kubernetes/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).To(0xc00035f6c0, 0x1b42140, 0xc000350dd0, 0xc000350de0, 0x1, 0x1, 0x42e35f)
  	/nvme/gopath/src/k8s.io/kubernetes/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:38 +0xc7
  k8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.3()
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:45 +0x17e
  k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc00029b0e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:65 +0x1c8
  testing.tRunner(0xc000358600, 0x19818c0)
  	/nvme/gopath/go/src/testing/testing.go:865 +0xc0
  created by testing.(*T).Run
  	/nvme/gopath/go/src/testing/testing.go:916 +0x35a

------------------------------
Jul 17 12:00:52.548: INFO: before
Jul 17 12:00:52.549: INFO: after
• Failure [0.002 seconds]
log
/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:35
  error [It]
  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:47

  hard-coded error
  Unexpected error:
      <*errors.errorString | 0xc000351930>: {
          s: "I'm an error, nice to meet to.",
      }
      I'm an error, nice to meet to.
  occurred

  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:49

  Full Stack Trace
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/util.go:1376 +0x191
  k8s.io/kubernetes/test/e2e/framework.ExpectNoError(...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/util.go:1367
  k8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.4()
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:49 +0xc9
  k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc00029b200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:65 +0x1c8
  testing.tRunner(0xc000358600, 0x19818c0)
  	/nvme/gopath/go/src/testing/testing.go:865 +0xc0
  created by testing.(*T).Run
  	/nvme/gopath/go/src/testing/testing.go:916 +0x35a

------------------------------
Jul 17 12:00:52.550: INFO: before
Jul 17 12:00:52.550: INFO: Unexpected error occurred: I'm an error, nice to meet to.
Jul 17 12:00:52.551: INFO: after
2019-08-26 11:32:25 +02:00
.github Update the PR template for latest 'additional documentation' enhancements 2019-08-19 12:34:11 +02:00
api generated 2019-08-24 22:20:35 -04:00
build Merge pull request #78033 from rajansandeep/corednsmigration 2019-08-20 20:39:16 -07:00
cluster Merge pull request #81428 from MrHohn/cpva-v0.8.1 2019-08-23 17:58:50 -07:00
cmd Merge pull request #81821 from hwdef/fix-typo-cmd/kubeadm/app/util/config/initconfiguration.go 2019-08-23 17:59:30 -07:00
docs
Godeps Merge pull request #78033 from rajansandeep/corednsmigration 2019-08-20 20:39:16 -07:00
hack Merge pull request #81812 from Huang-Wei/fix-bug-staticcheck 2019-08-25 19:54:20 -07:00
logo
pkg Merge pull request #81842 from verb/range-scheduler 2019-08-25 15:48:20 -07:00
plugin Merge pull request #81072 from draveness/feature/runtime-class-scheduling-admission-plugin 2019-08-23 22:26:37 -07:00
staging publishing: add missing deps for 1.16 branch 2019-08-26 12:18:48 +05:30
test e2e: unit test for logger.go and ginkgowrapper.go 2019-08-26 11:32:25 +02:00
third_party
translations
vendor Merge pull request #81752 from dims/hack-pick-up-test-go-files-in-verify-import-boss 2019-08-23 20:56:38 -07:00
.bazelrc
.generated_files
.gitattributes
.gitignore
.kazelcfg.json
BUILD.bazel
CHANGELOG-1.2.md
CHANGELOG-1.3.md
CHANGELOG-1.4.md
CHANGELOG-1.5.md
CHANGELOG-1.6.md
CHANGELOG-1.7.md
CHANGELOG-1.8.md
CHANGELOG-1.9.md
CHANGELOG-1.10.md
CHANGELOG-1.11.md
CHANGELOG-1.12.md
CHANGELOG-1.13.md Update CHANGELOG-1.13.md for v1.13.10. 2019-08-19 11:34:51 +00:00
CHANGELOG-1.14.md Update CHANGELOG-1.14.md for v1.14.6. 2019-08-19 12:17:37 +00:00
CHANGELOG-1.15.md Update CHANGELOG-1.15.md for v1.15.3. 2019-08-19 12:15:38 +00:00
CHANGELOG-1.16.md Fix CRD v1 release note 2019-08-20 11:46:27 -04:00
CHANGELOG.md
code-of-conduct.md
CONTRIBUTING.md
go.mod hack/pin-dependency.sh k8s.io/gengo 26a664648505d962332bda642b27306bc10d1082 2019-08-23 12:11:18 -04:00
go.sum hack/pin-dependency.sh k8s.io/gengo 26a664648505d962332bda642b27306bc10d1082 2019-08-23 12:11:18 -04:00
LICENSE
Makefile
Makefile.generated_files
OWNERS
OWNERS_ALIASES Add hex108 as a scheduler reviewer 2019-08-22 09:54:14 +08:00
README.md
SECURITY_CONTACTS
SUPPORT.md
WORKSPACE

Kubernetes

GoDoc Widget CII Best Practices


Kubernetes is an open source system for managing containerized applications across multiple hosts; providing basic mechanisms for deployment, maintenance, and scaling of applications.

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.

Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.


To start using Kubernetes

See our documentation on kubernetes.io.

Try our interactive tutorial.

Take a free course on Scalable Microservices with Kubernetes.

To start developing Kubernetes

The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.

If you want to build Kubernetes right away there are two options:

You have a working Go environment.
go get -d k8s.io/kubernetes
cd $GOPATH/src/k8s.io/kubernetes
make
You have a working Docker environment.
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
make quick-release

For the full story, head over to the developer's documentation.

Support

If you need support, start with the troubleshooting guide, and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another.

Analytics