Fix serialization test bugs and enable Go 1.27 compat - #637
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #637 +/- ##
==========================================
+ Coverage 75.12% 77.02% +1.90%
==========================================
Files 36 36
Lines 1419 1419
==========================================
+ Hits 1066 1093 +27
+ Misses 274 247 -27
Partials 79 79 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e22aedd to
279000c
Compare
|
suggestion: Expand the test runner matrix to include 1.27? (prevent regression + prove this works with the latest version) |
|
When the PR was opened, it wasn't released, but it is now. I'll get it updated. |
6cbc567 to
ea3d689
Compare
|
Ok, took a bit! Unrelated to this change, the golangci-lint action was broken because it uses the 'stable' version of Go, which is now Go 1.27, so patched that all up so it would pass.
|
|
Thanks @djedward for fixing both of the flaky tests 💯 About the change, I think I'm fine with dropping 1.15 <= support (EOL Aug 16, 2021), what do you think @trivenay ? No a big fan of all of those linting exceptions. Also could you bring back the shas in github actions? Dependabot understand them well, so it's fine to keep them, it's also in our policy to fix the action versions, thanks! |
|
Sounds good to me, I'll start with the hash locking so the versions don't upgrade. I would definitely be supportive of dropping <= 1.15, but I'll wait for consensus on that. |
|
Yes if someone wants to use the ric and they are using the deprecated version then they can use older ric versions -> This is the standard procedure we follow across all runtimes |
|
I've removed 1.13, 1.14 and 1.15 from the test matrix. I removed all the no longer necessary //nolint directives. |
Issue #, if available:
Description of changes:
The tests fail to build for Go 1.27 due to changes in the JSON library:
It exposed an existing bug in how TestMalformedJson was being used. The method is a pass-through to
json.Unmarshalwhich requires a pointer. Prior to 1.27, Go returned a SyntaxError, despite the issue being the target. I updated all the calls to properly pass a pointer and perform the check they were intending to check. I added tests for this function to make Codecov happy.Secondly, the error message in Go 1.27 for the types has changed some. This updates the tests to be a little more flexible in their matching, allowing Go 1.27 and earlier versions to pass.
TestEnableSigterm appeared to be flaky and timing out, so used a polling mechanism, increased the timeouts and pre-pulled the image to see if that resolves the flakiness (seems to have finally passed every version).
TestConcurrencyWithRIE occasionally had failures (mainly due to taking too long "5.1s not less that 4.4"), so applied similar changes as TestEnableSigterm.
Those are optional changes and I'm happy to remove them (or feel free to edit the commit to remove them). I implemented them to help get the tests to pass.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.