• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

camilamacedo86 / kubebuilder / 10809077669
82%
master: 74%

Build:
Build:
LAST BUILD BRANCH: test-add-helm
DEFAULT BRANCH: master
Ran 11 Sep 2024 09:44AM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Sep 2024 09:36AM UTC coverage: 81.773%. Remained the same
10809077669

push

github

camilamacedo86
(go/v4): Refactor e2e-tests for clearer error handling and readable logs

Refactors all test cases that use g.Expect(utils.Run(cmd)) to improve both the readability of logs and the clarity of the code.

Changes:

- Replaced occurrences of g.Expect(utils.Run(cmd)) with:

```go
output, err := utils.Run(cmd)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(string(output)).To(<condition>)
```

OR

```go
_, err := utils.Run(cmd)
g.Expect(err).NotTo(HaveOccurred())
```

**Motivation**

- **Human-readable logs:** Output is now converted to a string, providing more understandable logs by displaying actual kubectl command results instead of raw byte arrays.
- **Improved code clarity:** The previous `g.Expect(utils.Run(cmd))` usage did not make it clear that the function returns both output and error. By explicitly handling the output and err variables, the code is more transparent and easier to maintain.

**Example of problematic scenario**

Otherwise, we are unable to check the output when errors are faced. For example

Before the changes:

```sh
  [FAILED] Timed out after 120.001s.
  The function passed to Eventually failed at /home/runner/work/kubebuilder/kubebuilder/testdata/project-v4-multigroup/test/e2e/e2e_test.go:145 with:
  Metrics endpoint is not ready
  Expected
      <[]uint8 | len:151, cap:1024>: [78, 65, 77, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 69, 78, 68, 80, 79, 73, 78, 84, 83, 32, 32, 32, 65, 71, 69, 10, 112, 114, 111, 106, 101, 99, 116, 45, 118, 52, 45, 109, 117, 108, 116, 105, 103, 114, 111, 117, 112, 45, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114, 45, 109, 97, 110, 97, 103, 101, 114, 45, 109, 101, 116, 114, 105, 99, 115, 45, 115, 101, 114, 118, 105, 99, 101, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 50, 109, 51, 115, 10]
  to contain subs... (continued)

2288 of 2798 relevant lines covered (81.77%)

15.69 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10809077669.1 11 Sep 2024 09:44AM UTC 0
81.77
GitHub Action Run
Source Files on build 10809077669
Detailed source file information is not available for this build.
  • Back to Repo
  • 77a240fa on github
  • Prev Build on master (#10838447043)
  • Next Build on fix-outout-redability-e2e-tests (#10838570978)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc