Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kumactl) use strings for stderr output test check #2323

Merged
merged 1 commit into from
Jul 8, 2021
Merged

fix(kumactl) use strings for stderr output test check #2323

merged 1 commit into from
Jul 8, 2021

Conversation

jpeach
Copy link
Contributor

@jpeach jpeach commented Jul 6, 2021

Summary

If we assert that kumactl standard error is empty using a byte buffer,
then the Ginkgo error shows a hex dump, which isn't that easy to read.
Switch to checking for an empty standard error string so that Ginkgo
shows any error messages directly in the test failure.

Full changelog

N/A

Issues resolved

N/A

Documentation

N/A

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

If we assert that kumactl standard error is empty using a byte buffer,
then the Ginkgo error shows a hex dump, which isn't that easy to read.
Switch to checking for an empty standard error string so that Ginkgo
shows any error messages directly in the test failure.

Signed-off-by: James Peach <james.peach@konghq.com>
@jpeach jpeach requested a review from a team as a code owner July 6, 2021 22:51
@codecov-commenter
Copy link

Codecov Report

Merging #2323 (ce3475f) into master (1c6a7c2) will increase coverage by 0.39%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2323      +/-   ##
==========================================
+ Coverage   50.64%   51.04%   +0.39%     
==========================================
  Files         871      875       +4     
  Lines       40631    40664      +33     
==========================================
+ Hits        20579    20758     +179     
+ Misses      18062    17881     -181     
- Partials     1990     2025      +35     
Impacted Files Coverage Δ
api/internal/util/proto/proto.go 62.50% <0.00%> (ø)
api/internal/util/proto/types.go 100.00% <0.00%> (ø)
...kg/plugins/resources/k8s/native/pkg/test/within.go 100.00% <0.00%> (ø)
...k8s/native/controllers/proxytemplate_controller.go 0.00% <0.00%> (ø)
pkg/core/resources/model/rest/resource.go 66.66% <0.00%> (+1.51%) ⬆️
api/mesh/v1alpha1/dataplane_helpers.go 77.84% <0.00%> (+1.70%) ⬆️
pkg/insights/resyncer.go 62.91% <0.00%> (+2.81%) ⬆️
pkg/mads/server/server.go 84.76% <0.00%> (+2.85%) ⬆️
pkg/plugins/resources/memory/store.go 79.74% <0.00%> (+4.43%) ⬆️
api/mesh/v1alpha1/dataplane_insight_helpers.go 80.24% <0.00%> (+4.93%) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c6a7c2...ce3475f. Read the comment docs.

@jpeach jpeach merged commit 06274a4 into kumahq:master Jul 8, 2021
@jpeach jpeach deleted the fix/kumactl-test-stderr branch July 8, 2021 06:59
mergify bot pushed a commit that referenced this pull request Jul 8, 2021
If we assert that kumactl standard error is empty using a byte buffer,
then the Ginkgo error shows a hex dump, which isn't that easy to read.
Switch to checking for an empty standard error string so that Ginkgo
shows any error messages directly in the test failure.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit 06274a4)
jpeach added a commit that referenced this pull request Jul 9, 2021
If we assert that kumactl standard error is empty using a byte buffer,
then the Ginkgo error shows a hex dump, which isn't that easy to read.
Switch to checking for an empty standard error string so that Ginkgo
shows any error messages directly in the test failure.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit 06274a4)

Co-authored-by: James Peach <james.peach@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants