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

Improve the error messages in dynamic/internal/shim/grpcutil/replay #2817

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Jan 8, 2025

This was motivated while trying to add a test for #2815. Beyond adding comments, the major change is how the failure for differences in nested fields looks. It used to look like this:

go test -test.run \^TestConfigInDestroy\$
panic: fatal: An assertion has failed: field config does not match logged field \
	&{{} [] [] 0x14000410008} != &{{} [] [] 0x14000410008}

Observe that both sides of the != are identical.

It now looks like this:

$ go test -test.run \^TestConfigInDestroy\$
panic: fatal: An assertion has failed: field "terraformv6_pulumi config msgpack" does not match logged field \
	[134 83 71 ...] != [134 82 69 ...]

The path to the nested field is specified ("terraformv6_pulumi config msgpack") and we see a difference in the value displayed.

This was motivated while trying to add a test for
#2815. Beyond adding comments, the
major change is how the failure for differences in nested fields looks. It used to look
like this:

```console
go test -test.run \^TestConfigInDestroy\$
panic: fatal: An assertion has failed: field config does not match logged field \
	&{{} [] [] 0x14000410008} != &{{} [] [] 0x14000410008}
```

Observe that both sides of the `!=` are identical.

It now looks like this:

```console
$ go test -test.run \^TestConfigInDestroy\$
panic: fatal: An assertion has failed: field "terraformv6_pulumi config msgpack" does not match logged field \
	[134 83 71 ...] != [134 82 69 ...]
```

The path to the nested field is specified (`"terraformv6_pulumi config msgpack"`) and we
see a difference in the value displayed.
@iwahbe iwahbe requested review from VenelinMartinov and a team January 8, 2025 12:32
@iwahbe iwahbe self-assigned this Jan 8, 2025
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 78.26087% with 10 lines in your changes missing coverage. Please review.

Project coverage is 68.67%. Comparing base (2150faf) to head (aeeac4d).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
dynamic/internal/shim/grpcutil/replay.go 78.26% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2817      +/-   ##
==========================================
+ Coverage   68.63%   68.67%   +0.04%     
==========================================
  Files         325      325              
  Lines       41536    41536              
==========================================
+ Hits        28507    28524      +17     
+ Misses      11423    11407      -16     
+ Partials     1606     1605       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant