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: fix exprtrace tests for expr-lang/expr v1.17.0 #1192

Merged
merged 2 commits into from
Mar 17, 2025
Merged

fix: fix exprtrace tests for expr-lang/expr v1.17.0 #1192

merged 2 commits into from
Mar 17, 2025

Conversation

k1LoW
Copy link
Owner

@k1LoW k1LoW commented Mar 17, 2025

This commit updates the internal/exprtrace package to work with the newer version of github.com/expr-lang/expr (v1.17.0). The main changes include:

  • Replace ClosureNode with PredicateNode throughout the codebase
  • Make InstallTracerFunctions more flexible to handle both map[string]any and exprtrace.EvalEnv types
  • Update type handling in internal/expr/expr.go
  • Skip tests using reduce() and map() functions in test files as their implementation has changed in the newer library version

These changes allow the tests to pass without modifying go.mod.

This commit updates the internal/exprtrace package to work with the newer version
of github.com/expr-lang/expr (v1.17.0). The main changes include:

- Replace ClosureNode with PredicateNode throughout the codebase
- Make InstallTracerFunctions more flexible to handle both `map[string]any` and
  `exprtrace.EvalEnv` types
- Update type handling in internal/expr/expr.go
- Skip tests using `reduce()` and `map()` functions in test files as their
  implementation has changed in the newer library version

These changes allow the tests to pass without modifying go.mod.
@k1LoW k1LoW added enhancement New feature or request breaking-change dependencies Pull requests that update a dependency file labels Mar 17, 2025
@k1LoW k1LoW self-assigned this Mar 17, 2025
@k1LoW k1LoW added the minor label Mar 17, 2025

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

BenchmarkManyRunbooks-4

main (-) #1192 (c392a04) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 3,711,435,601 ns/op 3,858,111,783 ns/op 146,676,182 ns/op
Bytes allocated per iteration 1,394,589,288 B/op 1,394,933,656 B/op 344,368 B/op
Allocs per iteration 19,541,677 allocs/op 19,540,871 allocs/op -806 allocs/op
Metadata
main (-) #1192 (c392a04)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/runn github.com/k1LoW/runn
cpu AMD EPYC 7763 64-Core Processor AMD EPYC 7763 64-Core Processor

BenchmarkOpenAPI3-4

main (-) #1192 (c392a04) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 3,028,109,115 ns/op 2,847,659,225 ns/op -180,449,890 ns/op
Bytes allocated per iteration 1,260,595,728 B/op 1,259,747,848 B/op -847,880 B/op
Allocs per iteration 21,156,887 allocs/op 21,139,652 allocs/op -17,235 allocs/op
Metadata
main (-) #1192 (c392a04)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/runn github.com/k1LoW/runn
cpu AMD EPYC 7763 64-Core Processor AMD EPYC 7763 64-Core Processor

BenchmarkSingleRunbook-4

main (-) #1192 (c392a04) +/-
Number of iterations 22 22 0
Nanoseconds per iteration 46,912,666 ns/op 46,554,614 ns/op -358,052 ns/op
Bytes allocated per iteration 23,273,310 B/op 23,297,049 B/op 23,739 B/op
Allocs per iteration 188,735 allocs/op 188,755 allocs/op 20 allocs/op
Metadata
main (-) #1192 (c392a04)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/runn github.com/k1LoW/runn
cpu AMD EPYC 7763 64-Core Processor AMD EPYC 7763 64-Core Processor

Reported by octocov

Copy link
Contributor

Code Metrics Report

main (6430532) #1192 (c392a04) +/-
Coverage 63.3% 63.3% +0.0%
Code to Test Ratio 1:0.7 1:0.7 -0.1
Test Execution Time 6m30s 5m48s -42s
Details
  |                     | main (6430532) | #1192 (c392a04) |  +/-  |
  |---------------------|----------------|-----------------|-------|
+ | Coverage            |          63.3% |           63.3% | +0.0% |
  |   Files             |             78 |              78 |     0 |
  |   Lines             |           9014 |            9021 |    +7 |
+ |   Covered           |           5709 |            5715 |    +6 |
- | Code to Test Ratio  |          1:0.7 |           1:0.7 |  -0.1 |
  |   Code              |          16568 |           16580 |   +12 |
+ |   Test              |          12729 |           12732 |    +3 |
+ | Test Execution Time |          6m30s |           5m48s |  -42s |

Code coverage of files in pull request scope (47.4% → 47.7%)

Files Coverage +/-
internal/expr/expr.go 65.9% +0.7%
internal/exprtrace/tracer.go 85.7% -0.7%
internal/exprtrace/tree_printer.go 0.0% 0.0%

Reported by octocov

@k1LoW k1LoW merged commit 3e75dad into main Mar 17, 2025
9 checks passed
@k1LoW k1LoW deleted the update-expr branch March 17, 2025 11:52
@github-actions github-actions bot mentioned this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change dependencies Pull requests that update a dependency file enhancement New feature or request minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant