Skip to content

Commit

Permalink
feat(gnovm): add 'gno test -print-events' + cleanup machine between t…
Browse files Browse the repository at this point in the history
…ests (#2975)

- [x] add `gno test -print-events` flag for unit tests.
	Props to @r3v4s for his work on #2071
- [x] add `// Events:` support in `_filetests.gno`.
- [x] cleanup `gno.Machine` between unit tests (\o/) .

Fixes #1982 
Closes #2071 
Addresses #2007

---------

Signed-off-by: moul <[email protected]>
  • Loading branch information
moul authored Oct 23, 2024
1 parent d961785 commit f4c4204
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
echo "LOG_LEVEL=debug" >> $GITHUB_ENV
echo "LOG_PATH_DIR=$LOG_PATH_DIR" >> $GITHUB_ENV
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno test -v ./examples/...
- run: go run ./gnovm/cmd/gno test -v -print-events ./examples/...
lint:
strategy:
fail-fast: false
Expand Down
9 changes: 0 additions & 9 deletions examples/gno.land/p/demo/ownable/ownable_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ func TestNewWithAddress(t *testing.T) {
}
}

func TestOwner(t *testing.T) {
std.TestSetRealm(std.NewUserRealm(alice))

o := New()
expected := alice
got := o.Owner()
uassert.Equal(t, expected, got)
}

func TestTransferOwnership(t *testing.T) {
std.TestSetRealm(std.NewUserRealm(alice))

Expand Down
11 changes: 11 additions & 0 deletions examples/gno.land/r/demo/event/z1_filetest.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import "gno.land/r/demo/event"

func main() {
event.Emit("foo")
event.Emit("bar")
}

// Events:
// [{"type":"TAG","attrs":[{"key":"key","value":"foo"}],"pkg_path":"gno.land/r/demo/event","func":"Emit"},{"type":"TAG","attrs":[{"key":"key","value":"bar"}],"pkg_path":"gno.land/r/demo/event","func":"Emit"}]
9 changes: 3 additions & 6 deletions examples/gno.land/r/gnoland/events/events.gno
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ func AddEvent(name, description, link, location, startTime, endTime string) (str
sort.Sort(events)

std.Emit(EventAdded,
"id",
e.id,
"id", e.id,
)

return id, nil
Expand All @@ -92,8 +91,7 @@ func DeleteEvent(id string) {
events = append(events[:idx], events[idx+1:]...)

std.Emit(EventDeleted,
"id",
e.id,
"id", e.id,
)
}

Expand Down Expand Up @@ -142,8 +140,7 @@ func EditEvent(id string, name, description, link, location, startTime, endTime
}

std.Emit(EventEdited,
"id",
e.id,
"id", e.id,
)
}

Expand Down
13 changes: 9 additions & 4 deletions examples/gno.land/r/gnoland/events/events_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ func TestAddEventErrors(t *testing.T) {
}

func TestDeleteEvent(t *testing.T) {
events = nil // remove elements from previous tests - see issue #1982
std.TestSetOrigCaller(su)
std.TestSetRealm(suRealm)

e1Start := parsedTimeNow.Add(time.Hour * 24 * 5)
e1End := e1Start.Add(time.Hour * 4)
Expand All @@ -107,7 +108,8 @@ func TestDeleteEvent(t *testing.T) {
}

func TestEditEvent(t *testing.T) {
events = nil // remove elements from previous tests - see issue #1982
std.TestSetOrigCaller(su)
std.TestSetRealm(suRealm)

e1Start := parsedTimeNow.Add(time.Hour * 24 * 5)
e1End := e1Start.Add(time.Hour * 4)
Expand Down Expand Up @@ -136,7 +138,8 @@ func TestEditEvent(t *testing.T) {
}

func TestInvalidEdit(t *testing.T) {
events = nil // remove elements from previous tests - see issue #1982
std.TestSetOrigCaller(su)
std.TestSetRealm(suRealm)

uassert.PanicsWithMessage(t, ErrNoSuchID.Error(), func() {
EditEvent("123123", "", "", "", "", "", "")
Expand All @@ -162,9 +165,11 @@ func TestParseTimes(t *testing.T) {
}

func TestRenderEventWidget(t *testing.T) {
events = nil // remove elements from previous tests - see issue #1982
std.TestSetOrigCaller(su)
std.TestSetRealm(suRealm)

// No events yet
events = nil
out, err := RenderEventWidget(1)
uassert.NoError(t, err)
uassert.Equal(t, out, "No events.")
Expand Down
29 changes: 27 additions & 2 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
gno "github.com/gnolang/gno/gnovm/pkg/gnolang"
"github.com/gnolang/gno/gnovm/pkg/gnomod"
"github.com/gnolang/gno/gnovm/tests"
teststd "github.com/gnolang/gno/gnovm/tests/stdlibs/std"
"github.com/gnolang/gno/tm2/pkg/commands"
"github.com/gnolang/gno/tm2/pkg/errors"
"github.com/gnolang/gno/tm2/pkg/random"
Expand All @@ -35,6 +36,7 @@ type testCfg struct {
timeout time.Duration
updateGoldenTests bool
printRuntimeMetrics bool
printEvents bool
withNativeFallback bool
}

Expand Down Expand Up @@ -149,6 +151,13 @@ func (c *testCfg) RegisterFlags(fs *flag.FlagSet) {
false,
"print runtime metrics (gas, memory, cpu cycles)",
)

fs.BoolVar(
&c.printEvents,
"print-events",
false,
"print emitted events",
)
}

func execTest(cfg *testCfg, args []string, io commands.IO) error {
Expand Down Expand Up @@ -228,6 +237,7 @@ func gnoTestPkg(
rootDir = cfg.rootDir
runFlag = cfg.run
printRuntimeMetrics = cfg.printRuntimeMetrics
printEvents = cfg.printEvents

stdin = io.In()
stdout = io.Out()
Expand Down Expand Up @@ -295,7 +305,7 @@ func gnoTestPkg(
m.Alloc = gno.NewAllocator(maxAllocTx)
}
m.RunMemPackage(memPkg, true)
err := runTestFiles(m, tfiles, memPkg.Name, verbose, printRuntimeMetrics, runFlag, io)
err := runTestFiles(m, tfiles, memPkg.Name, verbose, printRuntimeMetrics, printEvents, runFlag, io)
if err != nil {
errs = multierr.Append(errs, err)
}
Expand Down Expand Up @@ -329,7 +339,7 @@ func gnoTestPkg(
memPkg.Path = memPkg.Path + "_test"
m.RunMemPackage(memPkg, true)

err := runTestFiles(m, ifiles, testPkgName, verbose, printRuntimeMetrics, runFlag, io)
err := runTestFiles(m, ifiles, testPkgName, verbose, printRuntimeMetrics, printEvents, runFlag, io)
if err != nil {
errs = multierr.Append(errs, err)
}
Expand Down Expand Up @@ -419,6 +429,7 @@ func runTestFiles(
pkgName string,
verbose bool,
printRuntimeMetrics bool,
printEvents bool,
runFlag string,
io commands.IO,
) (errs error) {
Expand Down Expand Up @@ -448,10 +459,24 @@ func runTestFiles(
m.RunFiles(n)

for _, test := range testFuncs.Tests {
// cleanup machine between tests
tests.CleanupMachine(m)

testFuncStr := fmt.Sprintf("%q", test.Name)

eval := m.Eval(gno.Call("runtest", testFuncStr))

if printEvents {
events := m.Context.(*teststd.TestExecContext).EventLogger.Events()
if events != nil {
res, err := json.Marshal(events)
if err != nil {
panic(err)
}
io.ErrPrintfln("EVENTS: %s", string(res))
}
}

ret := eval[0].GetString()
if ret == "" {
err := errors.New("failed to execute unit test: %q", test.Name)
Expand Down
33 changes: 33 additions & 0 deletions gnovm/cmd/gno/testdata/gno_test/filetest_events.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Test with a valid _filetest.gno file

gno test -print-events .

! stdout .+
stderr 'ok \. \d\.\d\ds'

gno test -print-events -v .

! stdout .+
stderr '=== RUN file/valid_filetest.gno'
stderr '--- PASS: file/valid_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'

-- valid.gno --
package valid

-- valid_filetest.gno --
package main

import "std"

func main() {
println("test")
std.Emit("EventA")
std.Emit("EventB", "keyA", "valA")
}

// Output:
// test

// Events:
// [{"type":"EventA","attrs":[],"pkg_path":"","func":"main"},{"type":"EventB","attrs":[{"key":"keyA","value":"valA"}],"pkg_path":"","func":"main"}]
26 changes: 26 additions & 0 deletions gnovm/cmd/gno/testdata/gno_test/multitest_events.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Test with a valid _test.gno file

gno test -print-events .

! stdout .+
stderr 'EVENTS: \[{\"type\":\"EventA\",\"attrs\":\[\],\"pkg_path\":\"gno.land/r/.*\",\"func\":\"TestA\"}\]'
stderr 'EVENTS: \[{\"type\":\"EventB\",\"attrs\":\[{\"key\":\"keyA\",\"value\":\"valA\"}\],\"pkg_path\":\"gno.land/r/.*\",\"func\":\"TestB\"},{\"type\":\"EventC\",\"attrs\":\[{\"key\":\"keyD\",\"value\":\"valD\"}\],\"pkg_path\":\"gno.land/r/.*\",\"func\":\"TestB\"}\]'
stderr 'ok \. \d\.\d\ds'

-- valid.gno --
package valid

-- valid_test.gno --
package valid

import "testing"
import "std"

func TestA(t *testing.T) {
std.Emit("EventA")
}

func TestB(t *testing.T) {
std.Emit("EventB", "keyA", "valA")
std.Emit("EventC", "keyD", "valD")
}
63 changes: 60 additions & 3 deletions gnovm/tests/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tests

import (
"bytes"
"encoding/json"
"fmt"
"go/ast"
"go/parser"
Expand Down Expand Up @@ -54,7 +55,7 @@ func TestContext(pkgPath string, send std.Coins) *teststd.TestExecContext {
pkgAddr := gno.DerivePkgAddr(pkgPath) // the addr of the pkgPath called.
caller := gno.DerivePkgAddr("user1.gno")

pkgCoins := std.MustParseCoins(ugnot.ValueString(200000000)).Add(send) // >= send.
pkgCoins := std.MustParseCoins(ugnot.ValueString(200_000_000)).Add(send) // >= send.
banker := newTestBanker(pkgAddr.Bech32(), pkgCoins)
ctx := stdlibs.ExecContext{
ChainID: "dev",
Expand All @@ -74,6 +75,19 @@ func TestContext(pkgPath string, send std.Coins) *teststd.TestExecContext {
}
}

// CleanupMachine can be called during two tests while reusing the same Machine instance.
func CleanupMachine(m *gno.Machine) {
prevCtx := m.Context.(*teststd.TestExecContext)
prevSend := prevCtx.OrigSend

newCtx := TestContext("", prevCtx.OrigSend)
pkgCoins := std.MustParseCoins(ugnot.ValueString(200_000_000)).Add(prevSend) // >= send.
banker := newTestBanker(prevCtx.OrigPkgAddr, pkgCoins)
newCtx.OrigPkgAddr = prevCtx.OrigPkgAddr
newCtx.Banker = banker
m.Context = newCtx
}

type runFileTestOptions struct {
nativeLibs bool
logger loggerFunc
Expand Down Expand Up @@ -110,7 +124,7 @@ func RunFileTest(rootDir string, path string, opts ...RunFileTestOption) error {
opt(&f)
}

directives, pkgPath, resWanted, errWanted, rops, stacktraceWanted, maxAlloc, send, preWanted := wantedFromComment(path)
directives, pkgPath, resWanted, errWanted, rops, eventsWanted, stacktraceWanted, maxAlloc, send, preWanted := wantedFromComment(path)
if pkgPath == "" {
pkgPath = "main"
}
Expand Down Expand Up @@ -347,6 +361,45 @@ func RunFileTest(rootDir string, path string, opts ...RunFileTestOption) error {
}
}
}
case "Events":
// panic if got unexpected error

if pnc != nil {
if tv, ok := pnc.(*gno.TypedValue); ok {
panic(fmt.Sprintf("fail on %s: got unexpected error: %s", path, tv.Sprint(m)))
} else { // happens on 'unknown import path ...'
panic(fmt.Sprintf("fail on %s: got unexpected error: %v", path, pnc))
}
}
// check result
events := m.Context.(*teststd.TestExecContext).EventLogger.Events()
evtjson, err := json.Marshal(events)
if err != nil {
panic(err)
}
evtstr := trimTrailingSpaces(string(evtjson))
if evtstr != eventsWanted {
if f.syncWanted {
// write output to file.
replaceWantedInPlace(path, "Events", evtstr)
} else {
// panic so tests immediately fail (for now).
if eventsWanted == "" {
panic(fmt.Sprintf("fail on %s: got unexpected events: %s", path, evtstr))
} else {
diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
A: difflib.SplitLines(eventsWanted),
B: difflib.SplitLines(evtstr),
FromFile: "Expected",
FromDate: "",
ToFile: "Actual",
ToDate: "",
Context: 1,
})
panic(fmt.Sprintf("fail on %s: diff:\n%s\n", path, diff))
}
}
}
case "Realm":
// panic if got unexpected error
if pnc != nil {
Expand Down Expand Up @@ -448,7 +501,7 @@ func RunFileTest(rootDir string, path string, opts ...RunFileTestOption) error {
return nil
}

func wantedFromComment(p string) (directives []string, pkgPath, res, err, rops, stacktrace string, maxAlloc int64, send std.Coins, pre string) {
func wantedFromComment(p string) (directives []string, pkgPath, res, err, rops, events, stacktrace string, maxAlloc int64, send std.Coins, pre string) {
fset := token.NewFileSet()
f, err2 := parser.ParseFile(fset, p, nil, parser.ParseComments)
if err2 != nil {
Expand Down Expand Up @@ -490,6 +543,10 @@ func wantedFromComment(p string) (directives []string, pkgPath, res, err, rops,
rops = strings.TrimPrefix(text, "Realm:\n")
rops = strings.TrimSpace(rops)
directives = append(directives, "Realm")
} else if strings.HasPrefix(text, "Events:\n") {
events = strings.TrimPrefix(text, "Events:\n")
events = strings.TrimSpace(events)
directives = append(directives, "Events")
} else if strings.HasPrefix(text, "Preprocessed:\n") {
pre = strings.TrimPrefix(text, "Preprocessed:\n")
pre = strings.TrimSpace(pre)
Expand Down

1 comment on commit f4c4204

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: f4c4204 Previous: d961785 Ratio
BenchmarkBinary/EmptyStruct:encode 466.8 ns/op 96 B/op 2 allocs/op 288.6 ns/op 96 B/op 2 allocs/op 1.62
BenchmarkBinary/EmptyStruct:encode - ns/op 466.8 ns/op 288.6 ns/op 1.62
BenchmarkBinary/EmptyStruct:decode 252.9 ns/op 0 B/op 0 allocs/op 136 ns/op 0 B/op 0 allocs/op 1.86
BenchmarkBinary/EmptyStruct:decode - ns/op 252.9 ns/op 136 ns/op 1.86
BenchmarkBinary/ShortArraysStruct:decode 439.4 ns/op 0 B/op 0 allocs/op 217.3 ns/op 0 B/op 0 allocs/op 2.02
BenchmarkBinary/ShortArraysStruct:decode - ns/op 439.4 ns/op 217.3 ns/op 2.02
BenchmarkBinary/EmbeddedSt1:encode 6067 ns/op 2037 B/op 65 allocs/op 4697 ns/op 2037 B/op 65 allocs/op 1.29
BenchmarkBinary/EmbeddedSt1:encode - ns/op 6067 ns/op 4697 ns/op 1.29
BenchmarkRemoved 38.79 ns/op 0 B/op 0 allocs/op 29.34 ns/op 0 B/op 0 allocs/op 1.32
BenchmarkRemoved - ns/op 38.79 ns/op 29.34 ns/op 1.32
BenchmarkRemoved 38.91 ns/op 0 B/op 0 allocs/op 29.34 ns/op 0 B/op 0 allocs/op 1.33
BenchmarkRemoved - ns/op 38.91 ns/op 29.34 ns/op 1.33
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 63650677 ns/op 5130 B/op 9 allocs/op 31848676 ns/op 5125 B/op 9 allocs/op 2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 63650677 ns/op 31848676 ns/op 2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 127281554 ns/op 5139 B/op 9 allocs/op 31848676 ns/op 5125 B/op 9 allocs/op 4.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 127281554 ns/op 31848676 ns/op 4.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 254997168 ns/op 5158 B/op 9 allocs/op 31848676 ns/op 5125 B/op 9 allocs/op 8.01
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 254997168 ns/op 31848676 ns/op 8.01
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 508647108 ns/op 5196 B/op 10 allocs/op 31848676 ns/op 5125 B/op 9 allocs/op 15.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 508647108 ns/op 31848676 ns/op 15.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 1017323785 ns/op 5528 B/op 13 allocs/op 31848676 ns/op 5125 B/op 9 allocs/op 31.94
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 1017323785 ns/op 31848676 ns/op 31.94
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op 13 allocs/op 9 allocs/op 1.44
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 2038594459 ns/op 5736 B/op 15 allocs/op 31848676 ns/op 5125 B/op 9 allocs/op 64.01
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 2038594459 ns/op 31848676 ns/op 64.01
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op 15 allocs/op 9 allocs/op 1.67
BenchmarkSigning 84203 ns/op 1856 B/op 36 allocs/op 25732 ns/op 64 B/op 1 allocs/op 3.27
BenchmarkSigning - ns/op 84203 ns/op 25732 ns/op 3.27
BenchmarkSigning - B/op 1856 B/op 64 B/op 29
BenchmarkSigning - allocs/op 36 allocs/op 1 allocs/op 36
BenchmarkSigning 82619 ns/op 1856 B/op 36 allocs/op 25732 ns/op 64 B/op 1 allocs/op 3.21
BenchmarkSigning - ns/op 82619 ns/op 25732 ns/op 3.21
BenchmarkSigning - B/op 1856 B/op 64 B/op 29
BenchmarkSigning - allocs/op 36 allocs/op 1 allocs/op 36
BenchmarkVerification 168339 ns/op 864 B/op 19 allocs/op 60972 ns/op 0 B/op 0 allocs/op 2.76
BenchmarkVerification - ns/op 168339 ns/op 60972 ns/op 2.76
BenchmarkVerification - B/op 864 B/op 0 B/op +∞
BenchmarkVerification - allocs/op 19 allocs/op 0 allocs/op +∞
BenchmarkVerification 167401 ns/op 864 B/op 19 allocs/op 60972 ns/op 0 B/op 0 allocs/op 2.75
BenchmarkVerification - ns/op 167401 ns/op 60972 ns/op 2.75
BenchmarkVerification - B/op 864 B/op 0 B/op +∞
BenchmarkVerification - allocs/op 19 allocs/op 0 allocs/op +∞
BenchmarkRandomBytes/random 68.87 ns/op 16 B/op 1 allocs/op 33.46 ns/op 4 B/op 1 allocs/op 2.06
BenchmarkRandomBytes/random - ns/op 68.87 ns/op 33.46 ns/op 2.06
BenchmarkRandomBytes/random - B/op 16 B/op 4 B/op 4
BenchmarkRandomBytes/random 105.9 ns/op 32 B/op 1 allocs/op 33.46 ns/op 4 B/op 1 allocs/op 3.16
BenchmarkRandomBytes/random - ns/op 105.9 ns/op 33.46 ns/op 3.16
BenchmarkRandomBytes/random - B/op 32 B/op 4 B/op 8
BenchmarkRandomBytes/random 268 ns/op 112 B/op 1 allocs/op 33.46 ns/op 4 B/op 1 allocs/op 8.01
BenchmarkRandomBytes/random - ns/op 268 ns/op 33.46 ns/op 8.01
BenchmarkRandomBytes/random - B/op 112 B/op 4 B/op 28
BenchmarkRandomBytes/random 2330 ns/op 1024 B/op 1 allocs/op 33.46 ns/op 4 B/op 1 allocs/op 69.64
BenchmarkRandomBytes/random - ns/op 2330 ns/op 33.46 ns/op 69.64
BenchmarkRandomBytes/random - B/op 1024 B/op 4 B/op 256
BenchmarkSmall/boltdb-1000-100-16-40/update 1439515 ns/op 44051 B/op 383 allocs/op 976476 ns/op 37401 B/op 371 allocs/op 1.47
BenchmarkSmall/boltdb-1000-100-16-40/update - ns/op 1439515 ns/op 976476 ns/op 1.47
BenchmarkSmall/memdb-1000-100-16-40/block 17578211 ns/op 9207128 B/op 167826 allocs/op 13193863 ns/op 6564968 B/op 116417 allocs/op 1.33
BenchmarkSmall/memdb-1000-100-16-40/block - ns/op 17578211 ns/op 13193863 ns/op 1.33
BenchmarkSmall/memdb-1000-100-16-40/block - B/op 9207128 B/op 6564968 B/op 1.40
BenchmarkSmall/memdb-1000-100-16-40/block - allocs/op 167826 allocs/op 116417 allocs/op 1.44
BenchmarkMedium/boltdb-100000-100-16-40/update - B/op 130037 B/op 101775 B/op 1.28
BenchmarkMedium/memdb-100000-100-16-40/update - B/op 364529 B/op 255768 B/op 1.43
BenchmarkMedium/memdb-100000-100-16-40/update - allocs/op 7221 allocs/op 4933 allocs/op 1.46
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - B/op 47758 B/op 39100 B/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - allocs/op 574 allocs/op 455 allocs/op 1.26
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/block - B/op 96799236 B/op 77924690 B/op 1.24
BenchmarkHash/ripemd160 2841 ns/op 25 B/op 1 allocs/op 703.2 ns/op 25 B/op 1 allocs/op 4.04
BenchmarkHash/ripemd160 - ns/op 2841 ns/op 703.2 ns/op 4.04
BenchmarkHash/sha2-256 521.5 ns/op 33 B/op 1 allocs/op 170.5 ns/op 33 B/op 1 allocs/op 3.06
BenchmarkHash/sha2-256 - ns/op 521.5 ns/op 170.5 ns/op 3.06
BenchmarkHash/sha3-256 1840 ns/op 33 B/op 1 allocs/op 714.2 ns/op 33 B/op 1 allocs/op 2.58
BenchmarkHash/sha3-256 - ns/op 1840 ns/op 714.2 ns/op 2.58
BenchmarkWriteSecretConnection 6434 ns/op 0 B/op 0 allocs/op 4044 ns/op 0 B/op 0 allocs/op 1.59
BenchmarkWriteSecretConnection - ns/op 6434 ns/op 4044 ns/op 1.59
BenchmarkReadSecretConnection 3219 ns/op 0 B/op 0 allocs/op 2361 ns/op 0 B/op 0 allocs/op 1.36
BenchmarkReadSecretConnection - ns/op 3219 ns/op 2361 ns/op 1.36
BenchmarkCacheStoreGetNoKeyFound - B/op 177 B/op 145 B/op 1.22

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ajnavarro @thehowl @zivkovicmilos

Please sign in to comment.