diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index e506cc07e2..0d47dafc71 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -108,7 +108,6 @@ jobs: - name: Run unit tests run: cd agent; make test -B - unit-test-web: name: WebUI unit tests runs-on: ubuntu-latest @@ -336,6 +335,11 @@ jobs: name: CLI e2e tests needs: [build-docker] runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + total_splits: [8] + index: [0,1,2,3,4,5,6,7] steps: - name: Checkout uses: actions/checkout@v3 @@ -348,6 +352,8 @@ jobs: docker load --input dist/image.tar - name: Run tests run: | + curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/main/install.sh | sh -s + find ./dist -name 'tracetest' -exec cp {} ./dist \; chmod +x ./dist/tracetest @@ -355,7 +361,8 @@ jobs: export TEST_ENVIRONMENT=jaeger cd ./testing/cli-e2etest - make test + + ../../bin/gotesplit -total ${{ matrix.total_splits }} -index ${{ matrix.index }} ./... -- -v -timeout 300s -p 1 # TODO: this would be a great idea but it doesn't work on GHA with docker # it can probablly be implemented with k8s in a separated job diff --git a/agent/go.mod b/agent/go.mod index c7411ad9c2..a682f6c2dc 100644 --- a/agent/go.mod +++ b/agent/go.mod @@ -1,6 +1,6 @@ module github.com/kubeshop/tracetest/agent -go 1.20 +go 1.21 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 diff --git a/api/definition.yaml b/api/definition.yaml index e8ba8d5da5..3b66503c9d 100644 --- a/api/definition.yaml +++ b/api/definition.yaml @@ -18,7 +18,7 @@ components: type: string description: resource ID runId: - type: string + type: integer description: run ID type: type: string diff --git a/api/expressions.yaml b/api/expressions.yaml index 6df1b223e3..cfa8ad3008 100644 --- a/api/expressions.yaml +++ b/api/expressions.yaml @@ -15,7 +15,7 @@ components: testId: type: string runId: - type: string + type: integer spanId: type: string selector: diff --git a/api/tests.yaml b/api/tests.yaml index 36e9851b95..8889eec147 100644 --- a/api/tests.yaml +++ b/api/tests.yaml @@ -143,7 +143,7 @@ components: type: object properties: id: - type: string + type: integer readOnly: true traceId: type: string @@ -230,7 +230,7 @@ components: testSuiteId: type: string testSuiteRunId: - type: string + type: integer RunInformation: type: object diff --git a/api/testsuites.yaml b/api/testsuites.yaml index de0fdc2b86..1ae90380f8 100644 --- a/api/testsuites.yaml +++ b/api/testsuites.yaml @@ -57,7 +57,7 @@ components: type: object properties: id: - type: string + type: integer readOnly: true version: type: integer diff --git a/cli/formatters/test_run.go b/cli/formatters/test_run.go index 336d0ea136..24f0abd869 100644 --- a/cli/formatters/test_run.go +++ b/cli/formatters/test_run.go @@ -293,8 +293,8 @@ func (f testRun) getColoredText(passed bool, text string) string { return pterm.FgRed.Sprintf(text) } -func (f testRun) GetRunLink(testID, runID string) string { - return fmt.Sprintf("%s/test/%s/run/%s/test", f.baseURLFn(), testID, runID) +func (f testRun) GetRunLink(testID string, runID int32) string { + return fmt.Sprintf("%s/test/%s/run/%d/test", f.baseURLFn(), testID, runID) } func (f testRun) getDeepLink(baseLink string, index int, spanID string) string { diff --git a/cli/formatters/test_run_test.go b/cli/formatters/test_run_test.go index 48ee721321..f44bd41026 100644 --- a/cli/formatters/test_run_test.go +++ b/cli/formatters/test_run_test.go @@ -19,7 +19,7 @@ func TestJSON(t *testing.T) { Name: openapi.PtrString("Testcase 1"), }, Run: openapi.TestRun{ - Id: openapi.PtrString("1"), + Id: openapi.PtrInt32(1), State: openapi.PtrString("FINISHED"), Result: &openapi.AssertionResults{ AllPassed: openapi.PtrBool(true), @@ -43,7 +43,7 @@ func TestSuccessfulTestRunOutput(t *testing.T) { Name: openapi.PtrString("Testcase 1"), }, Run: openapi.TestRun{ - Id: openapi.PtrString("1"), + Id: openapi.PtrInt32(1), State: openapi.PtrString("FINISHED"), TraceId: openapi.PtrString("cb5e80748cc06f8a63f6b96c056defec"), Result: &openapi.AssertionResults{ @@ -72,7 +72,7 @@ func TestSuccessfulTestRunOutputWithResult(t *testing.T) { }, }, Run: openapi.TestRun{ - Id: openapi.PtrString("1"), + Id: openapi.PtrInt32(1), TraceId: openapi.PtrString("cb5e80748cc06f8a63f6b96c056defec"), State: openapi.PtrString("FINISHED"), Result: &openapi.AssertionResults{ @@ -128,7 +128,7 @@ func TestFailingTestOutput(t *testing.T) { }, }, Run: openapi.TestRun{ - Id: openapi.PtrString("1"), + Id: openapi.PtrInt32(1), TraceId: openapi.PtrString("cb5e80748cc06f8a63f6b96c056defec"), Result: &openapi.AssertionResults{ AllPassed: openapi.PtrBool(false), @@ -220,7 +220,7 @@ func TestFailingTestOutputWithPadding(t *testing.T) { }, }, Run: openapi.TestRun{ - Id: openapi.PtrString("1"), + Id: openapi.PtrInt32(1), TraceId: openapi.PtrString("cb5e80748cc06f8a63f6b96c056defec"), Result: &openapi.AssertionResults{ AllPassed: openapi.PtrBool(false), diff --git a/cli/formatters/testsuite.go b/cli/formatters/testsuite.go index 725d5f5dc3..0aae5419e7 100644 --- a/cli/formatters/testsuite.go +++ b/cli/formatters/testsuite.go @@ -128,6 +128,6 @@ func (f testSuiteRun) getColoredText(passed bool, text string) string { return pterm.FgRed.Sprintf(text) } -func (f testSuiteRun) getRunLink(tsID, runID string) string { - return fmt.Sprintf("%s/testsuite/%s/run/%s", f.baseURLFn(), tsID, runID) +func (f testSuiteRun) getRunLink(tsID string, runID int32) string { + return fmt.Sprintf("%s/testsuite/%s/run/%d", f.baseURLFn(), tsID, runID) } diff --git a/cli/go.mod b/cli/go.mod index 0be03d30e3..2a57c85629 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,6 +1,6 @@ module github.com/kubeshop/tracetest/cli -go 1.20 +go 1.21 require ( github.com/Jeffail/gabs/v2 v2.7.0 @@ -11,8 +11,9 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/denisbrodbeck/machineid v1.0.1 github.com/goccy/go-yaml v1.11.0 + github.com/golang-jwt/jwt/v4 v4.5.0 github.com/goware/urlx v0.3.2 - github.com/kubeshop/tracetest/agent v0.0.0-20230908143300-4e0515ca5ecb + github.com/kubeshop/tracetest/agent v0.0.0-20230907210810-84198fc9f4ef github.com/kubeshop/tracetest/server v0.0.0-20230809150857-6314696222d3 github.com/pterm/pterm v0.12.55 github.com/spf13/cobra v1.7.0 @@ -51,7 +52,6 @@ require ( github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.3.0 // indirect diff --git a/cli/go.sum b/cli/go.sum index bdd27d7cdf..a74cc30143 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -1,4 +1,5 @@ atomicgo.dev/assert v0.0.2 h1:FiKeMiZSgRrZsPo9qn/7vmr7mCsh5SZyXY4YGYiYwrg= +atomicgo.dev/assert v0.0.2/go.mod h1:ut4NcI3QDdJtlmAxQULOmA13Gz6e2DWbSAS8RUOmNYQ= atomicgo.dev/cursor v0.1.1 h1:0t9sxQomCTRh5ug+hAMCs59x/UmC9QL6Ci5uosINKD4= atomicgo.dev/cursor v0.1.1/go.mod h1:Lr4ZJB3U7DfPPOkbH7/6TOtJ4vFGHlgj1nc+n900IpU= atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8= @@ -45,7 +46,9 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/bigtable v1.3.0/go.mod h1:z5EyKrPE8OQmeg4h5MNdKvuSnI9CCT49Ki3f23aBzio= cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -127,6 +130,7 @@ github.com/MarvinJWendt/testza v0.2.12/go.mod h1:JOIegYyV7rX+7VZ9r77L/eH6CfJHHzX github.com/MarvinJWendt/testza v0.3.0/go.mod h1:eFcL4I0idjtIx8P9C6KkAuLgATNKpX4/2oUqKc6bF2c= github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYewEjXsvsVUPbE= github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4= +github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.16.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= @@ -138,6 +142,7 @@ github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JP github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= @@ -168,6 +173,7 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/participle/v2 v2.0.0-alpha8 h1:X6nuChfgfQXNTE+ZdjTFSfnSNr8E07LSVLAqIIjtsGI= +github.com/alecthomas/participle/v2 v2.0.0-alpha8/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -226,6 +232,7 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/immutable v0.2.1/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI= github.com/benbjohnson/tmpl v1.0.0/go.mod h1:igT620JFIi44B6awvU9IsDhR77IXWtFigTLil/RPdps= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -242,6 +249,7 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+Wji github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bonitoo-io/go-sql-bigquery v0.3.4-1.4.0/go.mod h1:J4Y6YJm0qTWB9aFziB7cPeSyc6dOZFyJdteSeybVpXQ= github.com/brianvoe/gofakeit/v6 v6.17.0 h1:obbQTJeHfktJtiZzq0Q1bEpsNUs+yHrYlPVWt7BtmJ4= +github.com/brianvoe/gofakeit/v6 v6.17.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= @@ -255,6 +263,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEe github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= @@ -425,12 +434,15 @@ github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31 h1:Aq github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31/go.mod h1:XrR+08YQxO57vT8gtNmhLfHy/YIutMmmEeKMhU7zXqY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.11+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= @@ -480,6 +492,7 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fluidtruck/deepcopy v1.0.0 h1:StSep9r2WwYwDfoO7CWu1a8cZT5y3UUOelGxlSvFxIw= github.com/fluidtruck/deepcopy v1.0.0/go.mod h1:AinXaEHc7itYqWSjX9OOwxBbM8/ELusxM8WSwP4RroM= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -491,6 +504,7 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= @@ -628,10 +642,14 @@ github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE github.com/go-openapi/validate v0.20.2/go.mod h1:e7OJoKNgd0twXZwIn0A43tHbvIcr/rZIVCbJBpTUoY0= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis/v7 v7.4.1 h1:PASvf36gyUpr2zdOUS/9Zqc80GbM+9BDyiJSJDDOrTI= +github.com/go-redis/redis/v7 v7.4.1/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -689,6 +707,7 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= +github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= @@ -753,6 +772,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -806,6 +826,7 @@ github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1: github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -815,6 +836,7 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo= github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -930,10 +952,15 @@ github.com/influxdata/tdigest v0.0.2-0.20210216194612-fc98d27c9e8b/go.mod h1:Z0k github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j2gg0s/otsql v0.14.0 h1:keAORDX9RoQcc47KPE/wAyHZPCA7eI8uhXafpVcrWZ8= +github.com/j2gg0s/otsql v0.14.0/go.mod h1:AV9j/Nmw/qkSR74IAeCnsCQIQCXt7RR5XUZIxwQq6+Y= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgx/v5 v5.4.2 h1:u1gmGDwbdRUZiwisBm/Ky2M14uQyUP65bG8+20nnyrg= +github.com/jackc/pgx/v5 v5.4.2/go.mod h1:q6iHT8uDNXWiFNOlRqJzBTaSH3+2xCXkokxHZC5qWFY= github.com/jackc/puddle/v2 v2.2.0 h1:RdcDk92EJBuBS55nQMMYFXTxwstHug4jkhT5pq8VxPk= +github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= @@ -993,6 +1020,7 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= +github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= @@ -1013,8 +1041,8 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubeshop/tracetest/agent v0.0.0-20230908143300-4e0515ca5ecb h1:VqmDmeW1vadrwZLkd/3z5zQyw1cSOsgfiyjQ4PeT4tg= -github.com/kubeshop/tracetest/agent v0.0.0-20230908143300-4e0515ca5ecb/go.mod h1:99N6MkFTPMvfjafUVVy/yEFC/wDDXrE6NYDBUds31CI= +github.com/kubeshop/tracetest/agent v0.0.0-20230907210810-84198fc9f4ef h1:nGJP1wzFkIiYk842dwwHLzFpNXu17oyb3uoVujIDYK8= +github.com/kubeshop/tracetest/agent v0.0.0-20230907210810-84198fc9f4ef/go.mod h1:99N6MkFTPMvfjafUVVy/yEFC/wDDXrE6NYDBUds31CI= github.com/kubeshop/tracetest/server v0.0.0-20230809150857-6314696222d3 h1:vHwRPIkSN65w3fodVH5guMbIjEBaXVavNShdBTFN4NQ= github.com/kubeshop/tracetest/server v0.0.0-20230809150857-6314696222d3/go.mod h1:K5glIMRTzMw18u3jWl2KdOYD7cTo9Oq+LAjq1OVciHE= github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= @@ -1024,8 +1052,10 @@ github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4F github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ= +github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linode/linodego v1.2.1/go.mod h1:x/7+BoaKd4unViBmS2umdjYyVAmpFtBtEXZ0wou7FYQ= @@ -1152,6 +1182,7 @@ github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/ohler55/ojg v1.14.4 h1:L2ds8AlB5t/QbqSfhRwvagJzQ7pgmdrefMIypQs0Xik= +github.com/ohler55/ojg v1.14.4/go.mod h1:7Ghirupn8NC8hSSDpI0gcjorPxj+vSVIONDWfliHR1k= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= @@ -1183,6 +1214,7 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= +github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -1214,6 +1246,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/orlangure/gnomock v0.20.0 h1:YrgEekKJrglY0EOFnmIl46KjULufxdTeVvs9Y5CsYYE= +github.com/orlangure/gnomock v0.20.0/go.mod h1:N535y2x1yCqcNNCycTCHqBrpy0Nn/fBdTtZkbzOAWes= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1224,6 +1257,7 @@ github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUr github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= @@ -1345,6 +1379,7 @@ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210223165440-c65ae3540d44/ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= +github.com/segmentio/analytics-go/v3 v3.2.1/go.mod h1:p8owAF8X+5o27jmvUognuXxdtqvSGtD0ZrfY2kcS9bE= github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4= github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= @@ -1405,6 +1440,7 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1529,6 +1565,7 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/collector v0.60.0 h1:rHndW/xILGjNoFaYIvwYpngZnRWw1oQT6GLtzxIs7pw= go.opentelemetry.io/collector v0.60.0/go.mod h1:n2KBSgs7AakuedVxLR/Tayl3EEztmngrrjZBsYS+qBI= go.opentelemetry.io/collector/pdata v0.60.0 h1:jCNR5jtUom2FcUu30h4tw7enZytwGnXX6fs/K2FM/A0= @@ -1549,8 +1586,11 @@ go.opentelemetry.io/otel v1.5.0/go.mod h1:Jm/m+rNp/z0eqJc74H7LPwQ3G87qkU/AnnAydA go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.6.0 h1:w45y7bV0cy526utxqIdPU4FQmoptIhdpwlLPtCoMaPc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.6.0/go.mod h1:Yp+np0jiDujJ7horgIIxZkLlZv97ooiGkrNUTGHDcy0= go.opentelemetry.io/otel/metric v0.32.0 h1:lh5KMDB8xlMM4kwE38vlZJ3rZeiWrjw3As1vclfC01k= go.opentelemetry.io/otel/metric v0.32.0/go.mod h1:PVDNTt297p8ehm949jsIzd+Z2bIZJYQQG/uuHTeWFHY= go.opentelemetry.io/otel/sdk v1.5.0/go.mod h1:CU4J1v+7iEljnm1G14QjdFWOXUyYLHVh0Lh+/BTYyFg= @@ -1761,6 +1801,7 @@ golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2255,6 +2296,7 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/cli/openapi/model_resolve_context.go b/cli/openapi/model_resolve_context.go index 2c34b78c8b..3727db8de7 100644 --- a/cli/openapi/model_resolve_context.go +++ b/cli/openapi/model_resolve_context.go @@ -20,7 +20,7 @@ var _ MappedNullable = &ResolveContext{} // ResolveContext struct for ResolveContext type ResolveContext struct { TestId *string `json:"testId,omitempty"` - RunId *string `json:"runId,omitempty"` + RunId *int32 `json:"runId,omitempty"` SpanId *string `json:"spanId,omitempty"` Selector *string `json:"selector,omitempty"` VariableSetId *string `json:"variableSetId,omitempty"` @@ -76,9 +76,9 @@ func (o *ResolveContext) SetTestId(v string) { } // GetRunId returns the RunId field value if set, zero value otherwise. -func (o *ResolveContext) GetRunId() string { +func (o *ResolveContext) GetRunId() int32 { if o == nil || isNil(o.RunId) { - var ret string + var ret int32 return ret } return *o.RunId @@ -86,7 +86,7 @@ func (o *ResolveContext) GetRunId() string { // GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ResolveContext) GetRunIdOk() (*string, bool) { +func (o *ResolveContext) GetRunIdOk() (*int32, bool) { if o == nil || isNil(o.RunId) { return nil, false } @@ -102,8 +102,8 @@ func (o *ResolveContext) HasRunId() bool { return false } -// SetRunId gets a reference to the given string and assigns it to the RunId field. -func (o *ResolveContext) SetRunId(v string) { +// SetRunId gets a reference to the given int32 and assigns it to the RunId field. +func (o *ResolveContext) SetRunId(v int32) { o.RunId = &v } diff --git a/cli/openapi/model_test_run.go b/cli/openapi/model_test_run.go index dbdf89fb13..28e800b86f 100644 --- a/cli/openapi/model_test_run.go +++ b/cli/openapi/model_test_run.go @@ -20,7 +20,7 @@ var _ MappedNullable = &TestRun{} // TestRun struct for TestRun type TestRun struct { - Id *string `json:"id,omitempty"` + Id *int32 `json:"id,omitempty"` TraceId *string `json:"traceId,omitempty"` SpanId *string `json:"spanId,omitempty"` // Test version used when running this test run @@ -48,7 +48,7 @@ type TestRun struct { RequiredGatesResult *RequiredGatesResult `json:"requiredGatesResult,omitempty"` Metadata *map[string]string `json:"metadata,omitempty"` TestSuiteId *string `json:"testSuiteId,omitempty"` - TestSuiteRunId *string `json:"testSuiteRunId,omitempty"` + TestSuiteRunId *int32 `json:"testSuiteRunId,omitempty"` } // NewTestRun instantiates a new TestRun object @@ -69,9 +69,9 @@ func NewTestRunWithDefaults() *TestRun { } // GetId returns the Id field value if set, zero value otherwise. -func (o *TestRun) GetId() string { +func (o *TestRun) GetId() int32 { if o == nil || isNil(o.Id) { - var ret string + var ret int32 return ret } return *o.Id @@ -79,7 +79,7 @@ func (o *TestRun) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TestRun) GetIdOk() (*string, bool) { +func (o *TestRun) GetIdOk() (*int32, bool) { if o == nil || isNil(o.Id) { return nil, false } @@ -95,8 +95,8 @@ func (o *TestRun) HasId() bool { return false } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *TestRun) SetId(v string) { +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *TestRun) SetId(v int32) { o.Id = &v } @@ -805,9 +805,9 @@ func (o *TestRun) SetTestSuiteId(v string) { } // GetTestSuiteRunId returns the TestSuiteRunId field value if set, zero value otherwise. -func (o *TestRun) GetTestSuiteRunId() string { +func (o *TestRun) GetTestSuiteRunId() int32 { if o == nil || isNil(o.TestSuiteRunId) { - var ret string + var ret int32 return ret } return *o.TestSuiteRunId @@ -815,7 +815,7 @@ func (o *TestRun) GetTestSuiteRunId() string { // GetTestSuiteRunIdOk returns a tuple with the TestSuiteRunId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TestRun) GetTestSuiteRunIdOk() (*string, bool) { +func (o *TestRun) GetTestSuiteRunIdOk() (*int32, bool) { if o == nil || isNil(o.TestSuiteRunId) { return nil, false } @@ -831,8 +831,8 @@ func (o *TestRun) HasTestSuiteRunId() bool { return false } -// SetTestSuiteRunId gets a reference to the given string and assigns it to the TestSuiteRunId field. -func (o *TestRun) SetTestSuiteRunId(v string) { +// SetTestSuiteRunId gets a reference to the given int32 and assigns it to the TestSuiteRunId field. +func (o *TestRun) SetTestSuiteRunId(v int32) { o.TestSuiteRunId = &v } diff --git a/cli/openapi/model_test_suite_run.go b/cli/openapi/model_test_suite_run.go index 74e591b8ee..3099d3b658 100644 --- a/cli/openapi/model_test_suite_run.go +++ b/cli/openapi/model_test_suite_run.go @@ -20,7 +20,7 @@ var _ MappedNullable = &TestSuiteRun{} // TestSuiteRun struct for TestSuiteRun type TestSuiteRun struct { - Id *string `json:"id,omitempty"` + Id *int32 `json:"id,omitempty"` Version *int32 `json:"version,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` @@ -51,9 +51,9 @@ func NewTestSuiteRunWithDefaults() *TestSuiteRun { } // GetId returns the Id field value if set, zero value otherwise. -func (o *TestSuiteRun) GetId() string { +func (o *TestSuiteRun) GetId() int32 { if o == nil || isNil(o.Id) { - var ret string + var ret int32 return ret } return *o.Id @@ -61,7 +61,7 @@ func (o *TestSuiteRun) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TestSuiteRun) GetIdOk() (*string, bool) { +func (o *TestSuiteRun) GetIdOk() (*int32, bool) { if o == nil || isNil(o.Id) { return nil, false } @@ -77,8 +77,8 @@ func (o *TestSuiteRun) HasId() bool { return false } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *TestSuiteRun) SetId(v string) { +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *TestSuiteRun) SetId(v int32) { o.Id = &v } diff --git a/cli/runner/test_runner.go b/cli/runner/test_runner.go index 933eb7266f..5bf6ec327c 100644 --- a/cli/runner/test_runner.go +++ b/cli/runner/test_runner.go @@ -3,7 +3,6 @@ package runner import ( "context" "fmt" - "strconv" "github.com/kubeshop/tracetest/cli/formatters" "github.com/kubeshop/tracetest/cli/openapi" @@ -97,13 +96,9 @@ func (r testRunner) StartRun(ctx context.Context, resource any, runInfo openapi. func (r testRunner) UpdateResult(ctx context.Context, result RunResult) (RunResult, error) { test := result.Resource.(openapi.TestResource) run := result.Run.(openapi.TestRun) - runID, err := strconv.Atoi(run.GetId()) - if err != nil { - return RunResult{}, fmt.Errorf("invalid test run id format: %w", err) - } updated, _, err := r.openapiClient.ApiApi. - GetTestRun(ctx, test.Spec.GetId(), int32(runID)). + GetTestRun(ctx, test.Spec.GetId(), run.GetId()). Execute() if err != nil { @@ -123,16 +118,12 @@ func (r testRunner) UpdateResult(ctx context.Context, result RunResult) (RunResu func (r testRunner) JUnitResult(ctx context.Context, result RunResult) (string, error) { test := result.Resource.(openapi.TestResource) run := result.Run.(openapi.TestRun) - runID, err := strconv.Atoi(run.GetId()) - if err != nil { - return "", fmt.Errorf("invalid run id format: %w", err) - } junit, _, err := r.openapiClient.ApiApi. GetRunResultJUnit( ctx, test.Spec.GetId(), - int32(runID), + int32(run.GetId()), ). Execute() if err != nil { diff --git a/cli/runner/testsuite_runner.go b/cli/runner/testsuite_runner.go index 53a60d4860..fa3d9a7135 100644 --- a/cli/runner/testsuite_runner.go +++ b/cli/runner/testsuite_runner.go @@ -3,7 +3,6 @@ package runner import ( "context" "fmt" - "strconv" "github.com/kubeshop/tracetest/cli/formatters" "github.com/kubeshop/tracetest/cli/openapi" @@ -97,13 +96,9 @@ func (r testSuiteRunner) StartRun(ctx context.Context, resource any, runInfo ope func (r testSuiteRunner) UpdateResult(ctx context.Context, result RunResult) (RunResult, error) { testSuite := result.Resource.(openapi.TestSuiteResource) run := result.Run.(openapi.TestSuiteRun) - runID, err := strconv.Atoi(run.GetId()) - if err != nil { - return RunResult{}, fmt.Errorf("invalid test suite run id format: %w", err) - } updated, _, err := r.openapiClient.ApiApi. - GetTestSuiteRun(ctx, testSuite.Spec.GetId(), int32(runID)). + GetTestSuiteRun(ctx, testSuite.Spec.GetId(), *run.Id). Execute() if err != nil { diff --git a/examples/observability-driven-development-go-tracetest/bookstore/part1/tracetest/docker-compose.yaml b/examples/observability-driven-development-go-tracetest/bookstore/part1/tracetest/docker-compose.yaml index a45f2679bb..0cbf640ab7 100644 --- a/examples/observability-driven-development-go-tracetest/bookstore/part1/tracetest/docker-compose.yaml +++ b/examples/observability-driven-development-go-tracetest/bookstore/part1/tracetest/docker-compose.yaml @@ -9,7 +9,7 @@ services: timeout: 3s interval: 1s retries: 60 - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 networks: default: null restart: unless-stopped diff --git a/examples/observability-driven-development-go-tracetest/bookstore/part2.1/tracetest/docker-compose.yaml b/examples/observability-driven-development-go-tracetest/bookstore/part2.1/tracetest/docker-compose.yaml index a45f2679bb..0cbf640ab7 100644 --- a/examples/observability-driven-development-go-tracetest/bookstore/part2.1/tracetest/docker-compose.yaml +++ b/examples/observability-driven-development-go-tracetest/bookstore/part2.1/tracetest/docker-compose.yaml @@ -9,7 +9,7 @@ services: timeout: 3s interval: 1s retries: 60 - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 networks: default: null restart: unless-stopped diff --git a/examples/observability-driven-development-go-tracetest/bookstore/part2.2/tracetest/docker-compose.yaml b/examples/observability-driven-development-go-tracetest/bookstore/part2.2/tracetest/docker-compose.yaml index a45f2679bb..0cbf640ab7 100644 --- a/examples/observability-driven-development-go-tracetest/bookstore/part2.2/tracetest/docker-compose.yaml +++ b/examples/observability-driven-development-go-tracetest/bookstore/part2.2/tracetest/docker-compose.yaml @@ -9,7 +9,7 @@ services: timeout: 3s interval: 1s retries: 60 - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 networks: default: null restart: unless-stopped diff --git a/examples/observability-driven-development-go-tracetest/bookstore/part3.1/tracetest/docker-compose.yaml b/examples/observability-driven-development-go-tracetest/bookstore/part3.1/tracetest/docker-compose.yaml index 9026688cc6..291e47d56e 100644 --- a/examples/observability-driven-development-go-tracetest/bookstore/part3.1/tracetest/docker-compose.yaml +++ b/examples/observability-driven-development-go-tracetest/bookstore/part3.1/tracetest/docker-compose.yaml @@ -9,7 +9,7 @@ services: timeout: 3s interval: 1s retries: 60 - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 ports: - 16686:16686 networks: diff --git a/examples/observability-driven-development-go-tracetest/bookstore/part3.2/tracetest/docker-compose.yaml b/examples/observability-driven-development-go-tracetest/bookstore/part3.2/tracetest/docker-compose.yaml index 9026688cc6..291e47d56e 100644 --- a/examples/observability-driven-development-go-tracetest/bookstore/part3.2/tracetest/docker-compose.yaml +++ b/examples/observability-driven-development-go-tracetest/bookstore/part3.2/tracetest/docker-compose.yaml @@ -9,7 +9,7 @@ services: timeout: 3s interval: 1s retries: 60 - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 ports: - 16686:16686 networks: diff --git a/examples/observability-to-the-rescue/docker-compose.yaml b/examples/observability-to-the-rescue/docker-compose.yaml index 24ce5475f1..c9fcbb722b 100644 --- a/examples/observability-to-the-rescue/docker-compose.yaml +++ b/examples/observability-to-the-rescue/docker-compose.yaml @@ -109,7 +109,7 @@ services: - jaeger jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped ports: - 16686:16686 diff --git a/examples/quick-start-go-and-kafka/docker-compose.yaml b/examples/quick-start-go-and-kafka/docker-compose.yaml index 1a4ed88fc9..eb2e135124 100644 --- a/examples/quick-start-go-and-kafka/docker-compose.yaml +++ b/examples/quick-start-go-and-kafka/docker-compose.yaml @@ -116,7 +116,7 @@ services: condition: service_started jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped ports: - 16686:16686 diff --git a/examples/quick-start-jaeger-nodejs/tracetest/docker-compose.yaml b/examples/quick-start-jaeger-nodejs/tracetest/docker-compose.yaml index 22dfdf71cc..26636687b7 100644 --- a/examples/quick-start-jaeger-nodejs/tracetest/docker-compose.yaml +++ b/examples/quick-start-jaeger-nodejs/tracetest/docker-compose.yaml @@ -50,7 +50,7 @@ services: - ./tracetest/collector.config.yaml:/otel-local-config.yaml jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped ports: - "16686:16686" diff --git a/examples/quick-start-net-core/docker-compose.yaml b/examples/quick-start-net-core/docker-compose.yaml index c35393fc0a..d48a1682c0 100644 --- a/examples/quick-start-net-core/docker-compose.yaml +++ b/examples/quick-start-net-core/docker-compose.yaml @@ -61,7 +61,7 @@ services: - 4318:4318 jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] diff --git a/examples/quick-start-tail-sampling/docker-compose.yaml b/examples/quick-start-tail-sampling/docker-compose.yaml index 296a4ff880..d6eeef91c8 100644 --- a/examples/quick-start-tail-sampling/docker-compose.yaml +++ b/examples/quick-start-tail-sampling/docker-compose.yaml @@ -75,7 +75,7 @@ services: condition: service_started jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped ports: - 16686:16686 diff --git a/examples/tracetest-jaeger/collector.config.yaml b/examples/tracetest-jaeger/collector.config.yaml index 8bd0f3dbd7..b761f10e2d 100644 --- a/examples/tracetest-jaeger/collector.config.yaml +++ b/examples/tracetest-jaeger/collector.config.yaml @@ -14,8 +14,8 @@ processors: sampling_percentage: 100 exporters: - jaeger: - endpoint: jaeger:14250 + otlp/jaeger: + endpoint: jaeger:4317 tls: insecure: true @@ -24,4 +24,4 @@ service: traces: receivers: [otlp] processors: [probabilistic_sampler, batch] - exporters: [jaeger] + exporters: [otlp/jaeger] diff --git a/examples/tracetest-jaeger/docker-compose.yml b/examples/tracetest-jaeger/docker-compose.yml index 9ea7a7d5f4..043c5aad1c 100644 --- a/examples/tracetest-jaeger/docker-compose.yml +++ b/examples/tracetest-jaeger/docker-compose.yml @@ -55,12 +55,14 @@ services: - 4317:4317 jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] interval: 1s timeout: 3s retries: 60 + environment: + - COLLECTOR_OTLP_ENABLED=true ports: - - 16685:16685 + - 16686:16686 diff --git a/examples/tracetest-k6/docker-compose.yml b/examples/tracetest-k6/docker-compose.yml index 3e3d43e021..543c807e2f 100644 --- a/examples/tracetest-k6/docker-compose.yml +++ b/examples/tracetest-k6/docker-compose.yml @@ -54,7 +54,7 @@ services: - 4317:4317 jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] diff --git a/examples/tracetest-opensearch/docker-compose.yml b/examples/tracetest-opensearch/docker-compose.yml index d1cb728b55..c06dd1a578 100644 --- a/examples/tracetest-opensearch/docker-compose.yml +++ b/examples/tracetest-opensearch/docker-compose.yml @@ -57,11 +57,10 @@ services: condition: service_healthy data-prepper: - restart: unless-stopped - image: opensearchproject/data-prepper:1.5.1 + image: opensearchproject/data-prepper:latest volumes: - - ./opensearch/opensearch-analytics.yaml:/usr/share/data-prepper/pipelines.yaml - - ./opensearch/opensearch-data-prepper-config.yaml:/usr/share/data-prepper/data-prepper-config.yaml + - ./opensearch/opensearch-analytics.yaml:/usr/share/data-prepper/pipelines/pipelines.yaml + - ./opensearch/opensearch-data-prepper-config.yaml:/usr/share/data-prepper/config/data-prepper-config.yaml healthcheck: test: ["CMD", "bash", "-c", "printf 'GET / HTTP/1.1\n\n' > /dev/tcp/127.0.0.1/21890"] interval: 1s @@ -72,7 +71,7 @@ services: condition: service_healthy opensearch: - image: opensearchproject/opensearch:2.4.1 + image: opensearchproject/opensearch:latest environment: - discovery.type=single-node - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping @@ -89,7 +88,7 @@ services: soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems hard: 65536 healthcheck: - test: curl -s http://localhost:9200 >/dev/null || exit 1 + test: ["CMD", "curl", "-f", "http://localhost:9200/_cluster/health?wait_for_status=yellow", "-ku admin:admin"] interval: 5s - timeout: 10s - retries: 5 + timeout: 25s + retries: 4 diff --git a/examples/tracetest-opensearch/opensearch/opensearch-analytics.yaml b/examples/tracetest-opensearch/opensearch/opensearch-analytics.yaml index 346551d31b..7e760a1c8a 100644 --- a/examples/tracetest-opensearch/opensearch/opensearch-analytics.yaml +++ b/examples/tracetest-opensearch/opensearch/opensearch-analytics.yaml @@ -11,8 +11,8 @@ raw-pipeline: source: pipeline: name: "entry-pipeline" - prepper: - - otel_trace_raw_prepper: + processor: + - otel_trace_raw: sink: - opensearch: hosts: diff --git a/examples/tracetest-otel-demo/docker-compose.yaml b/examples/tracetest-otel-demo/docker-compose.yaml index ea2ec70af9..c19572064f 100644 --- a/examples/tracetest-otel-demo/docker-compose.yaml +++ b/examples/tracetest-otel-demo/docker-compose.yaml @@ -68,7 +68,7 @@ services: condition: service_healthy jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] diff --git a/examples/tracetest-provisioning-env/docker-compose.yml b/examples/tracetest-provisioning-env/docker-compose.yml index 0150bd8944..e1543347cf 100644 --- a/examples/tracetest-provisioning-env/docker-compose.yml +++ b/examples/tracetest-provisioning-env/docker-compose.yml @@ -53,7 +53,7 @@ services: - 4317:4317 jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] diff --git a/examples/tracetesting-kubernetes/kubetracing/docker-compose.yaml b/examples/tracetesting-kubernetes/kubetracing/docker-compose.yaml index bf6b1c77f3..1a85919a64 100644 --- a/examples/tracetesting-kubernetes/kubetracing/docker-compose.yaml +++ b/examples/tracetesting-kubernetes/kubetracing/docker-compose.yaml @@ -9,7 +9,7 @@ services: timeout: 3s interval: 1s retries: 60 - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped environment: - COLLECTOR_OTLP_ENABLED=true diff --git a/go.work b/go.work index 158a1edb66..718f8e26b3 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.20 +go 1.21 use ( ./agent diff --git a/go.work.sum b/go.work.sum index 54eddebb8b..fc0fe0d1db 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,4 +1,3 @@ -atomicgo.dev/assert v0.0.2/go.mod h1:ut4NcI3QDdJtlmAxQULOmA13Gz6e2DWbSAS8RUOmNYQ= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= @@ -65,6 +64,7 @@ cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2H cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= @@ -97,6 +97,7 @@ cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LK cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= @@ -125,6 +126,7 @@ cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1r cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= @@ -134,60 +136,108 @@ cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= github.com/Azure/azure-sdk-for-go v59.4.0+incompatible h1:gDA8odnngdNd3KYHL2NoK1j9vpWBgEnFSjKKLpkC8Aw= +github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= +github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs= +github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8= +github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII= +github.com/MarvinJWendt/testza v0.2.10/go.mod h1:pd+VWsoGUiFtq+hRKSU1Bktnn+DMCSrDrXDpX2bG66k= +github.com/MarvinJWendt/testza v0.2.12/go.mod h1:JOIegYyV7rX+7VZ9r77L/eH6CfJHHzXjB69adAhzZkI= +github.com/MarvinJWendt/testza v0.3.0/go.mod h1:eFcL4I0idjtIx8P9C6KkAuLgATNKpX4/2oUqKc6bF2c= +github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYewEjXsvsVUPbE= +github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY= +github.com/Shopify/toxiproxy/v2 v2.5.0/go.mod h1:yhM2epWtAmel9CB8r2+L+PCmhH6yH2pITaPAo7jxJl0= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alexeyco/simpletable v1.0.0 h1:ZQ+LvJ4bmoeHb+dclF64d0LX+7QAi7awsfCrptZrpHk= +github.com/alexeyco/simpletable v1.0.0/go.mod h1:VJWVTtGUnW7EKbMRH8cE13SigKGx/1fO2SeeOiGeBkk= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/containerd/containerd v1.6.18/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= +github.com/compose-spec/compose-go v1.5.1 h1:qch68VrytuoNMtklbdkhkI6FgDVLuFrUwWK1Lj828Xo= +github.com/compose-spec/compose-go v1.5.1/go.mod h1:nVa8sWM16GzxGLZ1kGrUtEt6RGimsdMmIzULVVD6S9k= +github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cucumber/ci-environment/go v0.0.0-20230703185945-ddbd134c44fd h1:YnPJcbnNHcsFFyckLIynp4B6nvT75GEpH+yOc8aYhhE= +github.com/cucumber/ci-environment/go v0.0.0-20230703185945-ddbd134c44fd/go.mod h1:W5gTLX4+0/cT8vgja6OSH3OsnuNK8HfTOK3PrXyGQ/Q= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31 h1:AqcwAyaSEkILnr/bLybFnM2i/+EW67JJIRs/4dWmzxo= +github.com/distribution/distribution/v3 v3.0.0-20220907155224-78b9c98c5c31/go.mod h1:XrR+08YQxO57vT8gtNmhLfHy/YIutMmmEeKMhU7zXqY= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= +github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= +github.com/gookit/color v1.5.2 h1:uLnfXcaFjlrDnQDT+NCBcfhrXqYTx/rcCa6xn01Y8yI= +github.com/gookit/color v1.5.2/go.mod h1:w8h4bGiHeeBpvQVePTutdbERIUf3oJE5lZ8HM0UgXyg= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= -github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= -github.com/jackc/pgconn v1.8.0 h1:FmjZ0rOyXTr1wfWs45i4a9vjnjWUAGpMuQLD9OSs+lw= -github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451 h1:WAvSpGf7MsFuzAtK4Vk7R4EVe+liW4x83r4oWu0WHKw= -github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA= -github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= -github.com/jackc/pgproto3/v2 v2.0.7 h1:6Pwi1b3QdY65cuv6SyVO0FgPd5J3Bl7wf/nQQjinHMA= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= -github.com/jackc/pgtype v1.6.2 h1:b3pDeuhbbzBYcg5kwNmNDun4pFUD/0AAr1kLXZLeNt8= -github.com/jackc/pgx/v4 v4.10.1 h1:/6Q3ye4myIj6AaplUm+eRcz4OhK9HAvFf4ePsG40LJY= +github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/puddle v1.1.3 h1:JnPg/5Q9xVJGfjsO5CPUOjnJps1JaRUm8I9FXVCFK94= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= +github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= +github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= +github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= +github.com/kubeshop/tracetest/agent v0.0.0-20230907210810-84198fc9f4ef/go.mod h1:99N6MkFTPMvfjafUVVy/yEFC/wDDXrE6NYDBUds31CI= +github.com/lithammer/fuzzysearch v1.1.5 h1:Ag7aKU08wp0R9QCfF4GoGST9HbmAIeLP7xwMrOBEp1c= +github.com/lithammer/fuzzysearch v1.1.5/go.mod h1:1R1LRNk7yKid1BaQkmuLQaHruxcC4HmAH30Dh61Ih1Q= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mostynb/go-grpc-compression v1.1.17 h1:N9t6taOJN3mNTTi0wDf4e3lp/G/ON1TP67Pn0vTUA9I= +github.com/mostynb/go-grpc-compression v1.1.17/go.mod h1:FUSBr0QjKqQgoDG/e0yiqlR6aqyXC39+g/hFLDfSsEY= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= @@ -195,32 +245,81 @@ github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJ github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= +github.com/pterm/pterm v0.12.27/go.mod h1:PhQ89w4i95rhgE+xedAoqous6K9X+r6aSOI2eFF7DZI= +github.com/pterm/pterm v0.12.29/go.mod h1:WI3qxgvoQFFGKGjGnJR849gU0TsEOvKn5Q8LlY1U7lg= +github.com/pterm/pterm v0.12.30/go.mod h1:MOqLIyMOgmTDz9yorcYbcw+HsgoZo3BQfg2wtl3HEFE= +github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEejaWgXU= +github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE= +github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8= +github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s= +github.com/pterm/pterm v0.12.55 h1:+yVQi8lyCi5Zwg5VyZWkLV/sJl3HCmqji9cyWzcThSU= +github.com/pterm/pterm v0.12.55/go.mod h1:7rswprkyxYOse1IMh79w42jvReNHxro4z9oHfqjIdzM= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4= +github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil/v3 v3.22.8/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI= +github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= +github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= +go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= +go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/collector v0.60.0 h1:rHndW/xILGjNoFaYIvwYpngZnRWw1oQT6GLtzxIs7pw= +go.opentelemetry.io/collector v0.60.0/go.mod h1:n2KBSgs7AakuedVxLR/Tayl3EEztmngrrjZBsYS+qBI= +go.opentelemetry.io/collector/pdata v0.60.0 h1:jCNR5jtUom2FcUu30h4tw7enZytwGnXX6fs/K2FM/A0= +go.opentelemetry.io/collector/pdata v0.60.0/go.mod h1:0hqgNMRneVXaLNelv3q0XKJbyBW9aMDwyC15pKd30+E= go.opentelemetry.io/collector/semconv v0.60.0/go.mod h1:aRkHuJ/OshtDFYluKEtnG5nkKTsy1HZuvZVHmakx+Vo= go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA= +go.opentelemetry.io/contrib/propagators/b3 v1.9.0 h1:Lzb9zU98jCE2kyfCjWfSSsiQoGtvBL+COxvUBf7FNhU= +go.opentelemetry.io/contrib/propagators/b3 v1.9.0/go.mod h1:fyx3gFXn+4w5uWTTiqaI8oBNBW/6w9Ow5zxXf7NGixU= go.opentelemetry.io/contrib/zpages v0.34.0/go.mod h1:zuVCe4eoOREH+liRJLCtGITqL3NiUvkdr6U/4j9iQRg= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= +go.opentelemetry.io/otel/metric v0.32.0 h1:lh5KMDB8xlMM4kwE38vlZJ3rZeiWrjw3As1vclfC01k= +go.opentelemetry.io/otel/metric v0.32.0/go.mod h1:PVDNTt297p8ehm949jsIzd+Z2bIZJYQQG/uuHTeWFHY= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -232,17 +331,21 @@ golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -274,4 +377,6 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= diff --git a/local-config/jaeger/docker-compose.yml b/local-config/jaeger/docker-compose.yml index 618d443078..7755c04e05 100644 --- a/local-config/jaeger/docker-compose.yml +++ b/local-config/jaeger/docker-compose.yml @@ -15,7 +15,7 @@ services: - 5432:5432 jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] diff --git a/run.sh b/run.sh index 689b0aaf1c..8830aef652 100755 --- a/run.sh +++ b/run.sh @@ -29,6 +29,7 @@ ps() { } down() { + docker compose $opts kill docker compose $opts down } diff --git a/server/app/app.go b/server/app/app.go index 5626ec379b..3c39835d8b 100644 --- a/server/app/app.go +++ b/server/app/app.go @@ -46,6 +46,8 @@ import ( var ( Version = "dev" Env = "dev" + + pgChannelName = "tracetest_queue" ) var EmptyDemoEnabled []string diff --git a/server/app/test_pipeline.go b/server/app/test_pipeline.go index 3c4370739e..5277a2ecaa 100644 --- a/server/app/test_pipeline.go +++ b/server/app/test_pipeline.go @@ -9,6 +9,7 @@ import ( "github.com/kubeshop/tracetest/server/executor/trigger" "github.com/kubeshop/tracetest/server/linter/analyzer" "github.com/kubeshop/tracetest/server/model" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/tracedb" @@ -88,11 +89,12 @@ func buildTestPipeline( tracer, subscriptionManager, eventEmitter, + execTestUpdater, ) cancelRunHandlerFn := executor.HandleRunCancelation(execTestUpdater, tracer, eventEmitter) - queueBuilder := executor.NewQueueBuilder(). + queueBuilder := executor.NewQueueConfigurer(). WithCancelRunHandlerFn(cancelRunHandlerFn). WithSubscriptor(subscriptionManager). WithDataStoreGetter(dsRepo). @@ -101,18 +103,18 @@ func buildTestPipeline( WithRunGetter(runRepo). WithInstanceID(instanceID) - pgQueue := executor.NewPostgresQueueDriver(pool) + pgQueue := pipeline.NewPostgresQueueDriver[executor.Job](pool, pgChannelName) - pipeline := executor.NewPipeline(queueBuilder, - executor.PipelineStep{Processor: triggerResolverWorker, Driver: pgQueue.Channel("trigger_resolve")}, - executor.PipelineStep{Processor: triggerExecuterWorker, Driver: pgQueue.Channel("trigger_execute")}, - executor.PipelineStep{Processor: triggerResultProcessorWorker, Driver: pgQueue.Channel("trigger_result")}, - executor.PipelineStep{Processor: tracePoller, Driver: pgQueue.Channel("tracePoller")}, - executor.PipelineStep{Processor: linterRunner, Driver: pgQueue.Channel("linterRunner")}, - executor.PipelineStep{Processor: assertionRunner, Driver: pgQueue.Channel("assertionRunner")}, + pipeline := pipeline.New(queueBuilder, + pipeline.Step[executor.Job]{Processor: triggerResolverWorker, Driver: pgQueue.Channel("trigger_resolve")}, + pipeline.Step[executor.Job]{Processor: triggerExecuterWorker, Driver: pgQueue.Channel("trigger_execute")}, + pipeline.Step[executor.Job]{Processor: triggerResultProcessorWorker, Driver: pgQueue.Channel("trigger_result")}, + pipeline.Step[executor.Job]{Processor: tracePoller, Driver: pgQueue.Channel("tracePoller")}, + pipeline.Step[executor.Job]{Processor: linterRunner, Driver: pgQueue.Channel("linterRunner")}, + pipeline.Step[executor.Job]{Processor: assertionRunner, Driver: pgQueue.Channel("assertionRunner")}, ) - const assertionRunnerStepIndex = 3 + const assertionRunnerStepIndex = 5 return executor.NewTestPipeline( pipeline, diff --git a/server/app/test_suite_pipeline.go b/server/app/test_suite_pipeline.go index 560b0b7822..15c5f86a2f 100644 --- a/server/app/test_suite_pipeline.go +++ b/server/app/test_suite_pipeline.go @@ -2,6 +2,7 @@ package app import ( "github.com/kubeshop/tracetest/server/executor" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/testsuite" ) @@ -13,12 +14,12 @@ func buildTestSuitePipeline( subscriptionManager *subscription.Manager, ) *executor.TestSuitesPipeline { tranRunner := executor.NewTestSuiteRunner(testRunner, runRepo, subscriptionManager) - queueBuilder := executor.NewQueueBuilder(). + queueBuilder := executor.NewQueueConfigurer(). WithTestSuiteGetter(tranRepo). WithTestSuiteRunGetter(runRepo) - pipeline := executor.NewPipeline(queueBuilder, - executor.PipelineStep{Processor: tranRunner, Driver: executor.NewInMemoryQueueDriver("testSuiteRunner")}, + pipeline := pipeline.New(queueBuilder, + pipeline.Step[executor.Job]{Processor: tranRunner, Driver: pipeline.NewInMemoryQueueDriver[executor.Job]("testSuiteRunner")}, ) return executor.NewTestSuitePipeline( diff --git a/server/executor/assertion_runner.go b/server/executor/assertion_runner.go index 616f908b4d..b004ecdb47 100644 --- a/server/executor/assertion_runner.go +++ b/server/executor/assertion_runner.go @@ -10,6 +10,7 @@ import ( "github.com/kubeshop/tracetest/server/expression" "github.com/kubeshop/tracetest/server/model/events" "github.com/kubeshop/tracetest/server/pkg/maps" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/variableset" @@ -39,7 +40,7 @@ func NewAssertionRunner( } } -func (e *defaultAssertionRunner) SetOutputQueue(Enqueuer) { +func (e *defaultAssertionRunner) SetOutputQueue(pipeline.Enqueuer[Job]) { // this is a no-op, as assertion runner does not need to enqueue anything } diff --git a/server/executor/linter_runner.go b/server/executor/linter_runner.go index f16881c1d8..b754ce2d13 100644 --- a/server/executor/linter_runner.go +++ b/server/executor/linter_runner.go @@ -9,6 +9,7 @@ import ( "github.com/kubeshop/tracetest/server/linter" "github.com/kubeshop/tracetest/server/linter/analyzer" "github.com/kubeshop/tracetest/server/model/events" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" ) @@ -22,7 +23,7 @@ type defaultLinterRunner struct { subscriptionManager *subscription.Manager eventEmitter EventEmitter analyzerGetter AnalyzerGetter - outputQueue Enqueuer + outputQueue pipeline.Enqueuer[Job] } func NewlinterRunner( @@ -39,7 +40,7 @@ func NewlinterRunner( } } -func (e *defaultLinterRunner) SetOutputQueue(queue Enqueuer) { +func (e *defaultLinterRunner) SetOutputQueue(queue pipeline.Enqueuer[Job]) { e.outputQueue = queue } diff --git a/server/executor/queue.go b/server/executor/queue.go index 09dc5c1f9a..76f99031e3 100644 --- a/server/executor/queue.go +++ b/server/executor/queue.go @@ -9,12 +9,11 @@ import ( "log" "strconv" - "github.com/alitto/pond" - "github.com/kubeshop/tracetest/server/datastore" "github.com/kubeshop/tracetest/server/executor/pollingprofile" "github.com/kubeshop/tracetest/server/http/middleware" "github.com/kubeshop/tracetest/server/pkg/id" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/testsuite" @@ -23,9 +22,6 @@ import ( ) const ( - QueueWorkerCount = 20 - QueueWorkerBufferSize = QueueWorkerCount * 1_000 // 1k jobs per worker - JobCountHeader string = "X-Tracetest-Job-Count" ) @@ -150,14 +146,6 @@ func (j *Job) IncreaseEnqueueCount() { j.Headers.SetInt(JobCountHeader, j.EnqueueCount()+1) } -type Enqueuer interface { - Enqueue(context.Context, Job) -} - -type QueueItemProcessor interface { - ProcessItem(context.Context, Job) -} - type pollingProfileGetter interface { Get(context.Context, id.ID) (pollingprofile.PollingProfile, error) } @@ -186,16 +174,7 @@ type subscriptor interface { Subscribe(string, subscription.Subscriber) } -type Listener interface { - Listen(Job) -} - -type QueueDriver interface { - Enqueue(Job) - SetListener(Listener) -} - -type QueueBuilder struct { +type queueConfigurer[T any] struct { cancelRunHandlerFn func(ctx context.Context, run test.Run) error subscriptor subscriptor @@ -211,57 +190,57 @@ type QueueBuilder struct { instanceID string } -func NewQueueBuilder() *QueueBuilder { - return &QueueBuilder{} +func NewQueueConfigurer() *queueConfigurer[Job] { + return &queueConfigurer[Job]{} } -func (qb *QueueBuilder) WithCancelRunHandlerFn(fn func(ctx context.Context, run test.Run) error) *QueueBuilder { +func (qb *queueConfigurer[T]) WithCancelRunHandlerFn(fn func(ctx context.Context, run test.Run) error) *queueConfigurer[T] { qb.cancelRunHandlerFn = fn return qb } -func (qb *QueueBuilder) WithSubscriptor(subscriptor subscriptor) *QueueBuilder { +func (qb *queueConfigurer[T]) WithSubscriptor(subscriptor subscriptor) *queueConfigurer[T] { qb.subscriptor = subscriptor return qb } -func (qb *QueueBuilder) WithRunGetter(runs testRunGetter) *QueueBuilder { +func (qb *queueConfigurer[T]) WithRunGetter(runs testRunGetter) *queueConfigurer[T] { qb.runs = runs return qb } -func (qb *QueueBuilder) WithInstanceID(id string) *QueueBuilder { +func (qb *queueConfigurer[T]) WithInstanceID(id string) *queueConfigurer[T] { qb.instanceID = id return qb } -func (qb *QueueBuilder) WithTestGetter(tests testGetter) *QueueBuilder { +func (qb *queueConfigurer[T]) WithTestGetter(tests testGetter) *queueConfigurer[T] { qb.tests = tests return qb } -func (qb *QueueBuilder) WithPollingProfileGetter(pollingProfiles pollingProfileGetter) *QueueBuilder { +func (qb *queueConfigurer[T]) WithPollingProfileGetter(pollingProfiles pollingProfileGetter) *queueConfigurer[T] { qb.pollingProfiles = pollingProfiles return qb } -func (qb *QueueBuilder) WithDataStoreGetter(dataStore dataStoreGetter) *QueueBuilder { +func (qb *queueConfigurer[T]) WithDataStoreGetter(dataStore dataStoreGetter) *queueConfigurer[T] { qb.dataStores = dataStore return qb } -func (qb *QueueBuilder) WithTestSuiteGetter(suites testSuiteGetter) *QueueBuilder { +func (qb *queueConfigurer[T]) WithTestSuiteGetter(suites testSuiteGetter) *queueConfigurer[T] { qb.testSuites = suites return qb } -func (qb *QueueBuilder) WithTestSuiteRunGetter(suiteRuns testSuiteRunGetter) *QueueBuilder { +func (qb *queueConfigurer[T]) WithTestSuiteRunGetter(suiteRuns testSuiteRunGetter) *queueConfigurer[T] { qb.testSuiteRuns = suiteRuns return qb } -func (qb *QueueBuilder) Build(driver QueueDriver, itemProcessor QueueItemProcessor) *Queue { - queue := &Queue{ +func (qb *queueConfigurer[T]) Configure(queue *pipeline.Queue[Job]) { + q := &Queue{ cancelRunHandlerFn: qb.cancelRunHandlerFn, subscriptor: qb.subscriptor, @@ -274,16 +253,12 @@ func (qb *QueueBuilder) Build(driver QueueDriver, itemProcessor QueueItemProcess pollingProfiles: qb.pollingProfiles, dataStores: qb.dataStores, - driver: driver, - itemProcessor: itemProcessor, - workerPool: pond.New(QueueWorkerCount, QueueWorkerBufferSize), - instanceID: qb.instanceID, } - driver.SetListener(queue) + queue.EnqueuePreprocessorFn = q.enqueuePreprocess + queue.ListenPreprocessorFn = q.listenPreprocess - return queue } type Queue struct { @@ -299,101 +274,59 @@ type Queue struct { pollingProfiles pollingProfileGetter dataStores dataStoreGetter - itemProcessor QueueItemProcessor - driver QueueDriver - workerPool *pond.WorkerPool - instanceID string } -func (q *Queue) SetDriver(driver QueueDriver) { - q.driver = driver - driver.SetListener(q) -} - func propagator() propagation.TextMapPropagator { return propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}, tenantPropagator{}) } -func (q Queue) Enqueue(ctx context.Context, job Job) { - select { - default: - case <-ctx.Done(): - return +func (q Queue) enqueuePreprocess(ctx context.Context, input Job) Job { + if input.Headers == nil { + input.Headers = &headers{} } + propagator().Inject(ctx, propagation.MapCarrier(*input.Headers)) + input.Headers.Set("InstanceID", q.instanceID) - // use a worker to enqueue the job in case the driver takes a bit to actually enqueue - // this way we release the caller as soon as possible - q.workerPool.Submit(func() { - if job.Headers == nil { - job.Headers = &headers{} - } - propagator().Inject(ctx, propagation.MapCarrier(*job.Headers)) - job.Headers.Set("InstanceID", q.instanceID) - - version := 1 - if job.Test.Version != nil { - version = *job.Test.Version - } - - newJob := Job{ - Headers: job.Headers, + version := 1 + if input.Test.Version != nil { + version = *input.Test.Version + } - Test: test.Test{ID: job.Test.ID}, - Run: test.Run{ID: job.Run.ID, TestVersion: version, TraceID: job.Run.TraceID}, + return Job{ + Headers: input.Headers, - TestSuite: testsuite.TestSuite{ID: job.TestSuite.ID}, - TestSuiteRun: testsuite.TestSuiteRun{ID: job.TestSuiteRun.ID}, + Test: test.Test{ID: input.Test.ID}, + Run: test.Run{ID: input.Run.ID, TestVersion: version, TraceID: input.Run.TraceID}, - PollingProfile: pollingprofile.PollingProfile{ID: job.PollingProfile.ID}, - DataStore: datastore.DataStore{ID: job.DataStore.ID}, - } - log.Printf("queue: enqueuing job for run %d", job.Run.ID) + TestSuite: testsuite.TestSuite{ID: input.TestSuite.ID}, + TestSuiteRun: testsuite.TestSuiteRun{ID: input.TestSuiteRun.ID}, - q.driver.Enqueue(newJob) - }) + PollingProfile: pollingprofile.PollingProfile{ID: input.PollingProfile.ID}, + DataStore: datastore.DataStore{ID: input.DataStore.ID}, + } } -func (q Queue) Listen(job Job) { +func (q Queue) listenPreprocess(ctx context.Context, job Job) (context.Context, Job) { log.Printf("queue: received job for run %d", job.Run.ID) // this is called when a new job is put in the queue and we need to process it - ctx := propagator().Extract(context.Background(), propagation.MapCarrier(*job.Headers)) + ctx = propagator().Extract(ctx, propagation.MapCarrier(*job.Headers)) ctx = context.WithValue(ctx, "LastInstanceID", job.Headers.Get("InstanceID")) ctx, cancelCtx := context.WithCancel(ctx) q.listenForStopRequests(context.Background(), cancelCtx, job) - newJob := Job{ - Headers: job.Headers, + return ctx, Job{ + Headers: job.Headers, + Test: q.resolveTest(ctx, job), + Run: q.resolveTestRun(ctx, job), + TestSuite: q.resolveTestSuite(ctx, job), + TestSuiteRun: q.resolveTestSuiteRun(ctx, job), + PollingProfile: q.resolvePollingProfile(ctx, job), + DataStore: q.resolveDataStore(ctx, job), } - newJob.Test = q.resolveTest(ctx, job) - // todo: revert when using actual queues - newJob.Run = q.resolveTestRun(ctx, job) - // todo: change the otlp server to have its own table - // newJob.Run = job.Run - - newJob.TestSuite = q.resolveTestSuite(ctx, job) - newJob.TestSuiteRun = q.resolveTestSuiteRun(ctx, job) - - newJob.PollingProfile = q.resolvePollingProfile(ctx, job) - newJob.DataStore = q.resolveDataStore(ctx, job) - - // Process the item with cancellation monitoring - select { - default: - case <-ctx.Done(): - return - } - - q.workerPool.Submit(func() { - log.Printf("queue: submit to processItem fn for run %d", job.Run.ID) - q.itemProcessor.ProcessItem(ctx, newJob) - }) -} -func (q *Queue) Stop() { - q.workerPool.StopAndWait() } type StopRequest struct { diff --git a/server/executor/queue_driver_in_memory.go b/server/executor/queue_driver_in_memory.go deleted file mode 100644 index 1a2256bb3d..0000000000 --- a/server/executor/queue_driver_in_memory.go +++ /dev/null @@ -1,59 +0,0 @@ -package executor - -import ( - "fmt" - "log" -) - -type loggerFn func(string, ...any) - -func newLoggerFn(name string) loggerFn { - return func(format string, params ...any) { - log.Printf("[%s] %s", name, fmt.Sprintf(format, params...)) - } -} - -func NewInMemoryQueueDriver(name string) *InMemoryQueueDriver { - return &InMemoryQueueDriver{ - log: newLoggerFn(fmt.Sprintf("InMemoryQueueDriver - %s", name)), - queue: make(chan Job), - exit: make(chan bool), - name: name, - } -} - -type InMemoryQueueDriver struct { - log loggerFn - queue chan Job - exit chan bool - listener Listener - name string -} - -func (qd *InMemoryQueueDriver) SetListener(l Listener) { - qd.listener = l -} - -func (qd InMemoryQueueDriver) Enqueue(job Job) { - qd.queue <- job -} - -func (qd InMemoryQueueDriver) Start() { - go func() { - qd.log("start") - for { - select { - case <-qd.exit: - qd.log("exit") - return - case job := <-qd.queue: - qd.listener.Listen(job) - } - } - }() -} - -func (qd InMemoryQueueDriver) Stop() { - qd.log("stopping") - qd.exit <- true -} diff --git a/server/executor/test_pipeline.go b/server/executor/test_pipeline.go index 893b58b7b8..5fb5c516e2 100644 --- a/server/executor/test_pipeline.go +++ b/server/executor/test_pipeline.go @@ -9,6 +9,7 @@ import ( "github.com/kubeshop/tracetest/server/executor/testrunner" "github.com/kubeshop/tracetest/server/model/events" "github.com/kubeshop/tracetest/server/pkg/id" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/variableset" @@ -16,9 +17,9 @@ import ( ) type TestPipeline struct { - *Pipeline + *pipeline.Pipeline[Job] updatePublisher updatePublisher - assertionQueue Enqueuer + assertionQueue pipeline.Enqueuer[Job] runs runsRepo trGetter testRunnerGetter ppGetter defaultPollingProfileGetter @@ -44,11 +45,11 @@ type updatePublisher interface { } func NewTestPipeline( - pipeline *Pipeline, + pipeline *pipeline.Pipeline[Job], updatePublisher updatePublisher, - assertionQueue Enqueuer, + assertionQueue pipeline.Enqueuer[Job], runs runsRepo, trGetter testRunnerGetter, ppGetter defaultPollingProfileGetter, diff --git a/server/executor/test_suite_runner.go b/server/executor/test_suite_runner.go index f9b001a8f9..d92669a386 100644 --- a/server/executor/test_suite_runner.go +++ b/server/executor/test_suite_runner.go @@ -7,6 +7,7 @@ import ( "github.com/kubeshop/tracetest/server/executor/testrunner" "github.com/kubeshop/tracetest/server/pkg/maps" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/testsuite" @@ -46,7 +47,7 @@ type persistentTransactionRunner struct { subscriptionManager *subscription.Manager } -func (r *persistentTransactionRunner) SetOutputQueue(_ Enqueuer) { +func (r *persistentTransactionRunner) SetOutputQueue(_ pipeline.Enqueuer[Job]) { // this is a no-op, as transaction runner does not need to enqueue anything } diff --git a/server/executor/test_suite_runner_test.go b/server/executor/test_suite_runner_test.go index 57105c5f68..42113923bd 100644 --- a/server/executor/test_suite_runner_test.go +++ b/server/executor/test_suite_runner_test.go @@ -13,6 +13,7 @@ import ( "github.com/kubeshop/tracetest/server/model" "github.com/kubeshop/tracetest/server/pkg/id" "github.com/kubeshop/tracetest/server/pkg/maps" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/testmock" @@ -160,12 +161,12 @@ func runTestSuiteRunnerTest(t *testing.T, withErrors bool, assert func(t *testin runner := executor.NewTestSuiteRunner(testRunner, transactionRunRepo, subscriptionManager) - queueBuilder := executor.NewQueueBuilder(). + queueBuilder := executor.NewQueueConfigurer(). WithTestSuiteGetter(transactionsRepo). WithTestSuiteRunGetter(transactionRunRepo) - pipeline := executor.NewPipeline(queueBuilder, - executor.PipelineStep{Processor: runner, Driver: executor.NewInMemoryQueueDriver("runner")}, + pipeline := pipeline.New(queueBuilder, + pipeline.Step[executor.Job]{Processor: runner, Driver: pipeline.NewInMemoryQueueDriver[executor.Job]("testSuiteRunner")}, ) transactionPipeline := executor.NewTestSuitePipeline(pipeline, transactionRunRepo) diff --git a/server/executor/test_suites_pipeline.go b/server/executor/test_suites_pipeline.go index b54c66f2dd..0a7e45ac47 100644 --- a/server/executor/test_suites_pipeline.go +++ b/server/executor/test_suites_pipeline.go @@ -4,13 +4,14 @@ import ( "context" "github.com/kubeshop/tracetest/server/executor/testrunner" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/testsuite" "github.com/kubeshop/tracetest/server/variableset" ) type TestSuitesPipeline struct { - *Pipeline + *pipeline.Pipeline[Job] runs testSuiteRunRepo } @@ -19,7 +20,7 @@ type testSuiteRunRepo interface { } func NewTestSuitePipeline( - pipeline *Pipeline, + pipeline *pipeline.Pipeline[Job], runs testSuiteRunRepo, ) *TestSuitesPipeline { return &TestSuitesPipeline{ diff --git a/server/executor/trace_poller.go b/server/executor/trace_poller.go index 4ab45bf969..299b7a3a08 100644 --- a/server/executor/trace_poller.go +++ b/server/executor/trace_poller.go @@ -10,6 +10,7 @@ import ( "github.com/kubeshop/tracetest/server/analytics" "github.com/kubeshop/tracetest/server/executor/pollingprofile" "github.com/kubeshop/tracetest/server/model/events" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/tracedb/connection" @@ -80,8 +81,8 @@ type tracePoller struct { pollerExecutor pollerExecutor subscriptionManager *subscription.Manager eventEmitter EventEmitter - inputQueue Enqueuer - outputQueue Enqueuer + inputQueue pipeline.Enqueuer[Job] + outputQueue pipeline.Enqueuer[Job] } func (tp tracePoller) handleDBError(err error) { @@ -103,11 +104,11 @@ func (tp tracePoller) isFirstRequest(job Job) bool { return job.EnqueueCount() == 0 } -func (tp *tracePoller) SetOutputQueue(queue Enqueuer) { +func (tp *tracePoller) SetOutputQueue(queue pipeline.Enqueuer[Job]) { tp.outputQueue = queue } -func (tp *tracePoller) SetInputQueue(queue Enqueuer) { +func (tp *tracePoller) SetInputQueue(queue pipeline.Enqueuer[Job]) { tp.inputQueue = queue } diff --git a/server/executor/trigger_executer_worker.go b/server/executor/trigger_executer_worker.go index 9bb0313bc8..2552ee41a4 100644 --- a/server/executor/trigger_executer_worker.go +++ b/server/executor/trigger_executer_worker.go @@ -8,9 +8,9 @@ import ( "os" "strings" - "github.com/kubeshop/tracetest/server/analytics" triggerer "github.com/kubeshop/tracetest/server/executor/trigger" "github.com/kubeshop/tracetest/server/model/events" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/test/trigger" "go.opentelemetry.io/otel/trace" @@ -35,10 +35,10 @@ type triggerExecuterWorker struct { updater RunUpdater tracer trace.Tracer eventEmitter EventEmitter - outputQueue Enqueuer + outputQueue pipeline.Enqueuer[Job] } -func (r *triggerExecuterWorker) SetOutputQueue(queue Enqueuer) { +func (r *triggerExecuterWorker) SetOutputQueue(queue pipeline.Enqueuer[Job]) { r.outputQueue = queue } @@ -80,30 +80,15 @@ func (r triggerExecuterWorker) ProcessItem(ctx context.Context, job Job) { } } - run = r.handleExecutionResult(run, response, err) run.SpanID = response.SpanID - + run.TriggerResult = response.Result + run = run.TriggerCompleted(run.TriggerResult) r.handleDBError(run, r.updater.Update(ctx, run)) job.Run = run r.outputQueue.Enqueue(ctx, job) } -func (r triggerExecuterWorker) handleExecutionResult(run test.Run, response triggerer.Response, err error) test.Run { - run = run.TriggerCompleted(response.Result) - if err != nil { - run = run.TriggerFailed(err) - - analytics.SendEvent("test_run_finished", "error", "", &map[string]string{ - "finalState": string(run.State), - }) - - return run - } - - return run.SuccessfullyTriggered() -} - func isConnectionError(err error) bool { for err != nil { // a dial error means we couldn't open a TCP connection (either host is not available or DNS doesn't exist) diff --git a/server/executor/trigger_resolver_worker.go b/server/executor/trigger_resolver_worker.go index e74629ee57..d615c00814 100644 --- a/server/executor/trigger_resolver_worker.go +++ b/server/executor/trigger_resolver_worker.go @@ -8,6 +8,7 @@ import ( triggerer "github.com/kubeshop/tracetest/server/executor/trigger" "github.com/kubeshop/tracetest/server/expression" "github.com/kubeshop/tracetest/server/model/events" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/test/trigger" "github.com/kubeshop/tracetest/server/tracedb" @@ -43,10 +44,10 @@ type triggerResolverWorker struct { newTraceDBFn tracedb.FactoryFunc dsRepo currentDataStoreGetter eventEmitter EventEmitter - outputQueue Enqueuer + outputQueue pipeline.Enqueuer[Job] } -func (r *triggerResolverWorker) SetOutputQueue(queue Enqueuer) { +func (r *triggerResolverWorker) SetOutputQueue(queue pipeline.Enqueuer[Job]) { r.outputQueue = queue } @@ -107,7 +108,6 @@ func (r triggerResolverWorker) ProcessItem(ctx context.Context, job Job) { }} executor := expression.NewExecutor(ds...) - triggerOptions := &triggerer.ResolveOptions{ Executor: executor, } diff --git a/server/executor/trigger_result_processor_worker.go b/server/executor/trigger_result_processor_worker.go index 28882037ce..498317dd27 100644 --- a/server/executor/trigger_result_processor_worker.go +++ b/server/executor/trigger_result_processor_worker.go @@ -4,8 +4,10 @@ import ( "context" "fmt" + "github.com/kubeshop/tracetest/server/analytics" "github.com/kubeshop/tracetest/server/model" "github.com/kubeshop/tracetest/server/model/events" + "github.com/kubeshop/tracetest/server/pkg/pipeline" "github.com/kubeshop/tracetest/server/subscription" "github.com/kubeshop/tracetest/server/test" "github.com/kubeshop/tracetest/server/test/trigger" @@ -21,11 +23,13 @@ func NewTriggerResultProcessorWorker( tracer trace.Tracer, subscriptionManager *subscription.Manager, eventEmitter EventEmitter, + updater RunUpdater, ) *triggerResultProcessorWorker { return &triggerResultProcessorWorker{ tracer: tracer, subscriptionManager: subscriptionManager, eventEmitter: eventEmitter, + updater: updater, } } @@ -33,10 +37,11 @@ type triggerResultProcessorWorker struct { tracer trace.Tracer subscriptionManager *subscription.Manager eventEmitter EventEmitter - outputQueue Enqueuer + outputQueue pipeline.Enqueuer[Job] + updater RunUpdater } -func (r *triggerResultProcessorWorker) SetOutputQueue(queue Enqueuer) { +func (r *triggerResultProcessorWorker) SetOutputQueue(queue pipeline.Enqueuer[Job]) { r.outputQueue = queue } @@ -56,6 +61,7 @@ func (r triggerResultProcessorWorker) ProcessItem(ctx context.Context, job Job) ctx, pollingSpan := r.tracer.Start(ctx, "Start processing trigger response") defer pollingSpan.End() + job.Run = r.handleExecutionResult(job.Run) triggerResult := job.Run.TriggerResult if triggerResult.Error != nil { err := triggerResult.Error.Error() @@ -85,6 +91,8 @@ func (r triggerResultProcessorWorker) ProcessItem(ctx context.Context, job Job) } } + r.handleDBError(job.Run, r.updater.Update(ctx, job.Run)) + r.outputQueue.Enqueue(ctx, job) } @@ -109,3 +117,17 @@ func (r triggerResultProcessorWorker) emitMismatchEndpointEvent(ctx context.Cont r.handleError(job.Run, emitErr) } } + +func (r triggerResultProcessorWorker) handleExecutionResult(run test.Run) test.Run { + if run.TriggerResult.Error != nil { + run = run.TriggerFailed(fmt.Errorf(run.TriggerResult.Error.ErrorMessage)) + + analytics.SendEvent("test_run_finished", "error", "", &map[string]string{ + "finalState": string(run.State), + }) + + return run + } + + return run.SuccessfullyTriggered() +} diff --git a/server/executor/workers/trigger_preparation_worker.go b/server/executor/workers/trigger_preparation_worker.go deleted file mode 100644 index be17f1e2f0..0000000000 --- a/server/executor/workers/trigger_preparation_worker.go +++ /dev/null @@ -1,24 +0,0 @@ -package workers - -import ( - "context" - - "github.com/kubeshop/tracetest/server/executor" - triggerer "github.com/kubeshop/tracetest/server/executor/trigger" - "github.com/kubeshop/tracetest/server/model" - "github.com/kubeshop/tracetest/server/test" -) - -type EventEmitter interface { - Emit(ctx context.Context, event model.TestRunEvent) error -} - -type TriggerPreparationWorker struct { - runRepository test.RunRepository - eventEmiter EventEmitter - triggers *triggerer.Registry -} - -func (w *TriggerPreparationWorker) ProcessItem(ctx context.Context, job executor.Job) { - -} diff --git a/server/http/controller.go b/server/http/controller.go index 30e5c39468..83f06b1360 100644 --- a/server/http/controller.go +++ b/server/http/controller.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "net/http" - "strconv" "github.com/kubeshop/tracetest/server/assertions/selectors" "github.com/kubeshop/tracetest/server/datastore" @@ -448,14 +447,8 @@ func (c *controller) buildDataStores(ctx context.Context, info openapi.ResolveRe }}, ds...) } - if context.RunId != "" && context.TestId != "" { - runId, err := strconv.Atoi(context.RunId) - - if err != nil { - return [][]expression.DataStore{}, err - } - - run, err := c.testRunRepository.GetRun(ctx, id.ID(context.TestId), runId) + if context.TestId != "" && context.RunId > 0 { + run, err := c.testRunRepository.GetRun(ctx, id.ID(context.TestId), int(context.RunId)) if err != nil { return [][]expression.DataStore{}, err } diff --git a/server/http/mappings/tests.go b/server/http/mappings/tests.go index 6c23d2ac9e..9d769e7340 100644 --- a/server/http/mappings/tests.go +++ b/server/http/mappings/tests.go @@ -40,7 +40,7 @@ func (m OpenAPI) TestSuiteRun(in testsuite.TestSuiteRun) openapi.TestSuiteRun { } return openapi.TestSuiteRun{ - Id: strconv.Itoa(in.ID), + Id: int32(in.ID), Version: int32(in.TestSuiteVersion), CreatedAt: in.CreatedAt, CompletedAt: in.CompletedAt, @@ -268,8 +268,10 @@ func (m OpenAPI) Run(in *test.Run) openapi.TestRun { return openapi.TestRun{} } + testSuiteID, _ := strconv.Atoi(in.TestSuiteID) + return openapi.TestRun{ - Id: strconv.Itoa(in.ID), + Id: int32(in.ID), TraceId: in.TraceID.String(), SpanId: in.SpanID.String(), State: string(in.State), @@ -290,7 +292,7 @@ func (m OpenAPI) Run(in *test.Run) openapi.TestRun { Metadata: in.Metadata, VariableSet: m.VariableSet(in.VariableSet), TestSuiteId: in.TestSuiteID, - TestSuiteRunId: in.TestSuiteRunID, + TestSuiteRunId: int32(testSuiteID), Linter: m.LinterResult(in.Linter), RequiredGatesResult: m.RequiredGatesResult(in.RequiredGatesResult), } @@ -391,7 +393,6 @@ func (m Model) Definition(in []openapi.TestSpec) test.Specs { func (m Model) Run(in openapi.TestRun) (*test.Run, error) { tid, _ := trace.TraceIDFromHex(in.TraceId) sid, _ := trace.SpanIDFromHex(in.SpanId) - id, _ := strconv.Atoi(in.Id) result, err := m.Result(in.Result) if err != nil { @@ -399,7 +400,7 @@ func (m Model) Run(in openapi.TestRun) (*test.Run, error) { } return &test.Run{ - ID: id, + ID: int(in.Id), TraceID: tid, SpanID: sid, State: test.RunState(in.State), diff --git a/server/openapi/model_resolve_context.go b/server/openapi/model_resolve_context.go index e22612b124..bde9c8cfcf 100644 --- a/server/openapi/model_resolve_context.go +++ b/server/openapi/model_resolve_context.go @@ -12,7 +12,7 @@ package openapi type ResolveContext struct { TestId string `json:"testId,omitempty"` - RunId string `json:"runId,omitempty"` + RunId int32 `json:"runId,omitempty"` SpanId string `json:"spanId,omitempty"` diff --git a/server/openapi/model_test_run.go b/server/openapi/model_test_run.go index d07b753965..d07a44d91f 100644 --- a/server/openapi/model_test_run.go +++ b/server/openapi/model_test_run.go @@ -14,7 +14,7 @@ import ( ) type TestRun struct { - Id string `json:"id,omitempty"` + Id int32 `json:"id,omitempty"` TraceId string `json:"traceId,omitempty"` @@ -65,7 +65,7 @@ type TestRun struct { TestSuiteId string `json:"testSuiteId,omitempty"` - TestSuiteRunId string `json:"testSuiteRunId,omitempty"` + TestSuiteRunId int32 `json:"testSuiteRunId,omitempty"` } // AssertTestRunRequired checks if the required fields are not zero-ed diff --git a/server/openapi/model_test_suite_run.go b/server/openapi/model_test_suite_run.go index f015a48fbc..5ddd3299e1 100644 --- a/server/openapi/model_test_suite_run.go +++ b/server/openapi/model_test_suite_run.go @@ -14,7 +14,7 @@ import ( ) type TestSuiteRun struct { - Id string `json:"id,omitempty"` + Id int32 `json:"id,omitempty"` Version int32 `json:"version,omitempty"` diff --git a/server/pkg/pipeline/inmemory_driver.go b/server/pkg/pipeline/inmemory_driver.go new file mode 100644 index 0000000000..2269127a08 --- /dev/null +++ b/server/pkg/pipeline/inmemory_driver.go @@ -0,0 +1,50 @@ +package pipeline + +import ( + "fmt" +) + +func NewInMemoryQueueDriver[T any](name string) *InMemoryQueueDriver[T] { + return &InMemoryQueueDriver[T]{ + log: newLoggerFn(fmt.Sprintf("InMemoryQueueDriver - %s", name)), + queue: make(chan T), + exit: make(chan bool), + name: name, + } +} + +type InMemoryQueueDriver[T any] struct { + log loggerFn + queue chan T + exit chan bool + listener Listener[T] + name string +} + +func (qd *InMemoryQueueDriver[T]) SetListener(l Listener[T]) { + qd.listener = l +} + +func (qd InMemoryQueueDriver[T]) Enqueue(item T) { + qd.queue <- item +} + +func (qd InMemoryQueueDriver[T]) Start() { + go func() { + qd.log("start") + for { + select { + case <-qd.exit: + qd.log("exit") + return + case job := <-qd.queue: + qd.listener.Listen(job) + } + } + }() +} + +func (qd InMemoryQueueDriver[T]) Stop() { + qd.log("stopping") + qd.exit <- true +} diff --git a/server/executor/pipeline.go b/server/pkg/pipeline/pipeline.go similarity index 50% rename from server/executor/pipeline.go rename to server/pkg/pipeline/pipeline.go index 32df2650eb..4413d4a1d2 100644 --- a/server/executor/pipeline.go +++ b/server/pkg/pipeline/pipeline.go @@ -1,49 +1,60 @@ -package executor +package pipeline import ( "context" "fmt" + "log" "reflect" ) -type Pipeline struct { - steps []PipelineStep // N - queues []*Queue // N + 1 +type loggerFn func(string, ...any) + +func newLoggerFn(name string) loggerFn { + return func(format string, params ...any) { + log.Printf("[%s] %s", name, fmt.Sprintf(format, params...)) + } +} + +type Pipeline[T any] struct { + steps []Step[T] // N + queues []*Queue[T] // N + 1 } -type workerDriver interface { - QueueDriver +type workerDriver[T any] interface { + QueueDriver[T] Start() Stop() } -type queueBuilder interface { - Build(QueueDriver, QueueItemProcessor) *Queue +type queueConfigurer[T any] interface { + Configure(*Queue[T]) } -type pipelineStep interface { - QueueItemProcessor - SetOutputQueue(Enqueuer) +type step[T any] interface { + QueueItemProcessor[T] + SetOutputQueue(Enqueuer[T]) } -type InputQueueSetter interface { - SetInputQueue(Enqueuer) +type InputQueueSetter[T any] interface { + SetInputQueue(Enqueuer[T]) } -type PipelineStep struct { - Driver workerDriver - Processor pipelineStep +type Step[T any] struct { + Driver workerDriver[T] + Processor step[T] } -func NewPipeline(builder queueBuilder, steps ...PipelineStep) *Pipeline { - pipeline := &Pipeline{ +func New[T any](cfg queueConfigurer[T], steps ...Step[T]) *Pipeline[T] { + pipeline := &Pipeline[T]{ steps: steps, - queues: make([]*Queue, 0, len(steps)), + queues: make([]*Queue[T], 0, len(steps)), } // setup an input queue for each pipeline step for _, step := range steps { - pipeline.queues = append(pipeline.queues, builder.Build(step.Driver, step.Processor)) + q := NewQueue[T](step.Driver, step.Processor) + cfg.Configure(q) + pipeline.queues = append(pipeline.queues, q) } // set the output queue for each step. the ouput queue of a processor (N) is the input queue of the next one (N+1) @@ -57,7 +68,7 @@ func NewPipeline(builder queueBuilder, steps ...PipelineStep) *Pipeline { // a processor might need to have a reference to its input queue, to requeue items for example. // This can be done if it implements the `InputQueueSetter` interace - if setter, ok := reflect.ValueOf(step.Processor).Interface().(InputQueueSetter); ok { + if setter, ok := reflect.ValueOf(step.Processor).Interface().(InputQueueSetter[T]); ok { setter.SetInputQueue(pipeline.queues[i]) } } @@ -65,7 +76,7 @@ func NewPipeline(builder queueBuilder, steps ...PipelineStep) *Pipeline { return pipeline } -func (p *Pipeline) GetQueueForStep(i int) *Queue { +func (p *Pipeline[T]) GetQueueForStep(i int) *Queue[T] { if i < 0 || i >= len(p.queues) { return nil } @@ -73,21 +84,21 @@ func (p *Pipeline) GetQueueForStep(i int) *Queue { return p.queues[i] } -func (p *Pipeline) Begin(ctx context.Context, job Job) { +func (p *Pipeline[T]) Begin(ctx context.Context, item T) { if len(p.queues) < 1 { // this is a panic instead of an error because this could only happen during development panic(fmt.Errorf("pipeline has no input queue")) } - p.queues[0].Enqueue(ctx, job) + p.queues[0].Enqueue(ctx, item) } -func (p *Pipeline) Start() { +func (p *Pipeline[T]) Start() { for _, step := range p.steps { step.Driver.Start() } } -func (p *Pipeline) Stop() { +func (p *Pipeline[T]) Stop() { for _, step := range p.steps { step.Driver.Stop() } diff --git a/server/executor/queue_driver_postgres.go b/server/pkg/pipeline/postgres_driver.go similarity index 63% rename from server/executor/queue_driver_postgres.go rename to server/pkg/pipeline/postgres_driver.go index d5c43bf5ea..f71ba193a8 100644 --- a/server/executor/queue_driver_postgres.go +++ b/server/pkg/pipeline/postgres_driver.go @@ -1,4 +1,4 @@ -package executor +package pipeline import ( "context" @@ -11,32 +11,34 @@ import ( "github.com/kubeshop/tracetest/server/pkg/id" ) -func NewPostgresQueueDriver(pool *pgxpool.Pool) *PostgresQueueDriver { +func NewPostgresQueueDriver[T any](pool *pgxpool.Pool, channelName string) *postgresQueueDriver[T] { id := id.GenerateID() - return &PostgresQueueDriver{ - log: newLoggerFn("PostgresQueueDriver - " + id.String()), - pool: pool, - channels: map[string]*channel{}, - exit: make(chan bool), + return &postgresQueueDriver[T]{ + log: newLoggerFn("PostgresQueueDriver - " + id.String()), + channelName: channelName, + pool: pool, + channels: map[string]*channel[T]{}, + exit: make(chan bool), } } -// PostgresQueueDriver is a queue driver that uses Postgres LISTEN/NOTIFY +// postgresQueueDriver is a queue driver that uses Postgres LISTEN/NOTIFY // Since each queue needs its own connection, it's not practical/scalable // to create a new Driver instance for each queue. Instead, we create a // single Driver instance and use it to create channels for each queue. // // This driver requires one connection that listens to messages in any queue // and routes them to the correct worker. -type PostgresQueueDriver struct { - log loggerFn - pool *pgxpool.Pool - channels map[string]*channel - running bool - exit chan bool +type postgresQueueDriver[T any] struct { + log loggerFn + channelName string + pool *pgxpool.Pool + channels map[string]*channel[T] + running bool + exit chan bool } -func (qd *PostgresQueueDriver) getChannel(name string) (*channel, error) { +func (qd *postgresQueueDriver[T]) getChannel(name string) (*channel[T], error) { ch, ok := qd.channels[name] if !ok { return nil, fmt.Errorf("channel %s not found", name) @@ -45,14 +47,12 @@ func (qd *PostgresQueueDriver) getChannel(name string) (*channel, error) { return ch, nil } -const pgChannelName = "tracetest_queue" - -type pgJob struct { +type pgJob[T any] struct { Channel string `json:"channel"` - Job Job `json:"job"` + Item T `json:"job"` } -func (qd *PostgresQueueDriver) Start() { +func (qd *postgresQueueDriver[T]) Start() { if qd.running { // we want only 1 worker here qd.log("already running") @@ -60,7 +60,7 @@ func (qd *PostgresQueueDriver) Start() { } qd.running = true - go func(qd *PostgresQueueDriver) { + go func(qd *postgresQueueDriver[T]) { qd.log("start") qd.log("acquiring connection") @@ -82,9 +82,9 @@ func (qd *PostgresQueueDriver) Start() { }(qd) } -func (qd *PostgresQueueDriver) worker(conn *pgxpool.Conn) { +func (qd *postgresQueueDriver[T]) worker(conn *pgxpool.Conn) { qd.log("listening for notifications") - _, err := conn.Exec(context.Background(), "listen "+pgChannelName) + _, err := conn.Exec(context.Background(), "listen "+qd.channelName) if err != nil { qd.log("error listening for notifications: %s", err.Error()) return @@ -96,14 +96,14 @@ func (qd *PostgresQueueDriver) worker(conn *pgxpool.Conn) { return } - job := pgJob{} + job := pgJob[T]{} err = json.Unmarshal([]byte(notification.Payload), &job) if err != nil { qd.log("error unmarshalling pgJob: %s", err.Error()) return } - qd.log("received job for channel: %s, runID: %d", job.Channel, job.Job.Run.ID) + qd.log("received job for channel: %s") channel, err := qd.getChannel(job.Channel) if err != nil { @@ -111,24 +111,23 @@ func (qd *PostgresQueueDriver) worker(conn *pgxpool.Conn) { return } - // spin off so we can keep listening for jobs - channel.listener.Listen(job.Job) - qd.log("spun off job for channel: %s, runID: %d", job.Channel, job.Job.Run.ID) + qd.log("processing job for channel: %s", job.Channel) + channel.listener.Listen(job.Item) } -func (qd *PostgresQueueDriver) Stop() { +func (qd *postgresQueueDriver[T]) Stop() { qd.log("stopping") qd.exit <- true } // Channel registers a new queue channel and returns it -func (qd *PostgresQueueDriver) Channel(name string) *channel { +func (qd *postgresQueueDriver[T]) Channel(name string) *channel[T] { if _, channelNameExists := qd.channels[name]; channelNameExists { panic(fmt.Errorf("channel %s already exists", name)) } - ch := &channel{ - PostgresQueueDriver: qd, + ch := &channel[T]{ + postgresQueueDriver: qd, name: name, log: newLoggerFn(fmt.Sprintf("PostgresQueueDriver - %s", name)), pool: qd.pool, @@ -139,26 +138,26 @@ func (qd *PostgresQueueDriver) Channel(name string) *channel { return ch } -type channel struct { - *PostgresQueueDriver +type channel[T any] struct { + *postgresQueueDriver[T] name string log loggerFn pool *pgxpool.Pool - listener Listener + listener Listener[T] } -func (ch *channel) SetListener(l Listener) { +func (ch *channel[T]) SetListener(l Listener[T]) { ch.listener = l } const enqueueTimeout = 5 * time.Minute -func (ch *channel) Enqueue(job Job) { - ch.log("enqueue job for run %d", job.Run.ID) +func (ch *channel[T]) Enqueue(item T) { + ch.log("enqueue item") - jj, err := json.Marshal(pgJob{ + jj, err := json.Marshal(pgJob[T]{ Channel: ch.name, - Job: job, + Item: item, }) if err != nil { @@ -170,7 +169,7 @@ func (ch *channel) Enqueue(job Job) { defer cancelCtx() conn, err := again.Retry[*pgxpool.Conn](ctx, func(ctx context.Context) (*pgxpool.Conn, error) { - ch.log("trying to acquire connection for run %d", job.Run.ID) + ch.log("trying to acquire connection") return ch.pool.Acquire(context.Background()) }) @@ -178,14 +177,14 @@ func (ch *channel) Enqueue(job Job) { ch.log("error acquiring connection: %s", err.Error()) return } - ch.log("aquired connection for run %d", job.Run.ID) + ch.log("aquired connection for") defer conn.Release() - _, err = conn.Query(ctx, fmt.Sprintf(`select pg_notify('%s', $1)`, pgChannelName), jj) + _, err = conn.Query(ctx, fmt.Sprintf(`select pg_notify('%s', $1)`, ch.postgresQueueDriver.channelName), jj) if err != nil { ch.log("error notifying postgres: %s", err.Error()) return } - ch.log("notified postgres for run %d", job.Run.ID) + ch.log("notified postgres") } diff --git a/server/pkg/pipeline/queue.go b/server/pkg/pipeline/queue.go new file mode 100644 index 0000000000..035421ca8b --- /dev/null +++ b/server/pkg/pipeline/queue.go @@ -0,0 +1,95 @@ +package pipeline + +import ( + "context" + + "github.com/alitto/pond" +) + +type Enqueuer[T any] interface { + Enqueue(context.Context, T) +} + +type QueueItemProcessor[T any] interface { + ProcessItem(context.Context, T) +} +type Listener[T any] interface { + Listen(T) +} + +type QueueDriver[T any] interface { + Enqueue(T) + SetListener(Listener[T]) +} + +type Queue[T any] struct { + driver QueueDriver[T] + itemProcessor QueueItemProcessor[T] + + EnqueuePreprocessorFn func(context.Context, T) T + ListenPreprocessorFn func(context.Context, T) (context.Context, T) + + workerPool *pond.WorkerPool +} + +const ( + QueueWorkerCount = 20 + QueueWorkerBufferSize = QueueWorkerCount * 1_000 // 1k jobs per worker +) + +func NewQueue[T any](driver QueueDriver[T], itemProcessor QueueItemProcessor[T]) *Queue[T] { + queue := &Queue[T]{ + itemProcessor: itemProcessor, + workerPool: pond.New(QueueWorkerCount, QueueWorkerBufferSize), + } + + queue.SetDriver(driver) + + return queue +} + +func (q *Queue[T]) SetDriver(driver QueueDriver[T]) { + q.driver = driver + driver.SetListener(q) +} + +func (q Queue[T]) Enqueue(ctx context.Context, item T) { + select { + default: + case <-ctx.Done(): + return + } + + // use a worker to enqueue the job in case the driver takes a bit to actually enqueue + // this way we release the caller as soon as possible + q.workerPool.Submit(func() { + if q.EnqueuePreprocessorFn != nil { + item = q.EnqueuePreprocessorFn(ctx, item) + } + + q.driver.Enqueue(item) + }) +} + +func (q Queue[T]) Listen(item T) { + ctx := context.Background() + + if q.ListenPreprocessorFn != nil { + ctx, item = q.ListenPreprocessorFn(ctx, item) + } + + // Process the item with cancellation monitoring + select { + default: + case <-ctx.Done(): + return + } + + q.workerPool.Submit(func() { + q.itemProcessor.ProcessItem(ctx, item) + }) +} + +func (q *Queue[T]) Stop() { + q.workerPool.StopAndWait() +} diff --git a/server/test/trigger/trigger.go b/server/test/trigger/trigger.go index 025834cbea..758c84258a 100644 --- a/server/test/trigger/trigger.go +++ b/server/test/trigger/trigger.go @@ -15,7 +15,7 @@ type ( TriggerResult struct { Type TriggerType `json:"type"` - HTTP *HTTPResponse `json:"httpRequest,omitempty"` + HTTP *HTTPResponse `json:"http,omitempty"` GRPC *GRPCResponse `json:"grpc,omitempty"` TraceID *TraceIDResponse `json:"traceid,omitempty"` Kafka *KafkaResponse `json:"kafka,omitempty"` diff --git a/server/tracedb/opensearchdb.go b/server/tracedb/opensearchdb.go index 0ae5906af8..922996ddc5 100644 --- a/server/tracedb/opensearchdb.go +++ b/server/tracedb/opensearchdb.go @@ -68,9 +68,17 @@ func (db *opensearchDB) GetTraceByID(ctx context.Context, traceID string) (trace if !db.Ready() { return traces.Trace{}, fmt.Errorf("OpenSearch dataStore not ready") } + content := strings.NewReader(fmt.Sprintf(`{ - "query": { "match": { "traceId": "%s" } } - }`, traceID)) + "query": { + "bool": { + "should": [ + { "match": { "traceId": "%s" } }, + { "match": { "traceID": "%s" } } + ] + } + } + }`, traceID, traceID)) searchRequest := opensearchapi.SearchRequest{ Index: []string{db.config.Index}, diff --git a/testing/cli-e2etest/environment/jaeger/server-setup/docker-compose-no-api.yaml b/testing/cli-e2etest/environment/jaeger/server-setup/docker-compose-no-api.yaml index 4b068a1e44..4baf7cff30 100644 --- a/testing/cli-e2etest/environment/jaeger/server-setup/docker-compose-no-api.yaml +++ b/testing/cli-e2etest/environment/jaeger/server-setup/docker-compose-no-api.yaml @@ -53,7 +53,7 @@ services: - 4317 jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.48.0 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "localhost:16686"] diff --git a/testing/load/infra/docker-compose.yaml b/testing/load/infra/docker-compose.yaml index 69910c0c01..553aece7fc 100644 --- a/testing/load/infra/docker-compose.yaml +++ b/testing/load/infra/docker-compose.yaml @@ -58,7 +58,7 @@ services: - 4318:4318 jaeger: - # image: jaegertracing/all-in-one:latest + # image: jaegertracing/all-in-one:1.48.0 image: jaegertracing/all-in-one:1.46.0 restart: unless-stopped healthcheck: diff --git a/web/src/components/Editor/Expression/Expression.tsx b/web/src/components/Editor/Expression/Expression.tsx index c0376b6975..a33e758676 100644 --- a/web/src/components/Editor/Expression/Expression.tsx +++ b/web/src/components/Editor/Expression/Expression.tsx @@ -30,7 +30,7 @@ const Expression = ({ onSelectAutocompleteOption = noop, context = {}, }: IEditorProps) => { - const {testId = '', runId = ''} = context; + const {testId = '', runId = 0} = context; const [isHovering, setIsHovering] = useState(false); const {selectedVariableSet} = useVariableSet(); const editorTheme = useEditorTheme(); diff --git a/web/src/components/Editor/Expression/hooks/useAutoComplete.ts b/web/src/components/Editor/Expression/hooks/useAutoComplete.ts index 521852c028..981aef66b5 100644 --- a/web/src/components/Editor/Expression/hooks/useAutoComplete.ts +++ b/web/src/components/Editor/Expression/hooks/useAutoComplete.ts @@ -10,7 +10,7 @@ import {SupportedEditors} from 'constants/Editor.constants'; interface IProps { testId: string; - runId: string; + runId: number; onSelect?(option: Completion): void; autocompleteCustomValues: string[]; } diff --git a/web/src/components/Editor/Selector/hooks/useAutoComplete.ts b/web/src/components/Editor/Selector/hooks/useAutoComplete.ts index 6c176ee624..19af2ce65e 100644 --- a/web/src/components/Editor/Selector/hooks/useAutoComplete.ts +++ b/web/src/components/Editor/Selector/hooks/useAutoComplete.ts @@ -16,7 +16,7 @@ import {escapeString} from 'utils/Common'; interface IProps { testId: string; - runId: string; + runId: number; } const useAutoComplete = ({testId, runId}: IProps) => { diff --git a/web/src/components/Editor/Selector/hooks/useLint.ts b/web/src/components/Editor/Selector/hooks/useLint.ts index 3173880884..d01a0d1163 100644 --- a/web/src/components/Editor/Selector/hooks/useLint.ts +++ b/web/src/components/Editor/Selector/hooks/useLint.ts @@ -7,7 +7,7 @@ import AssertionSelectors from 'selectors/Assertion.selectors'; interface IProps { testId: string; - runId: string; + runId: number; } const useLint = ({runId, testId}: IProps): LintSource => { diff --git a/web/src/components/FileViewerModal/FileViewerModal.provider.tsx b/web/src/components/FileViewerModal/FileViewerModal.provider.tsx index 5b0a8046c9..e8a22868d0 100644 --- a/web/src/components/FileViewerModal/FileViewerModal.provider.tsx +++ b/web/src/components/FileViewerModal/FileViewerModal.provider.tsx @@ -6,7 +6,7 @@ import useDefinitionFile from 'hooks/useDefinitionFile'; import useJUnitResult from 'hooks/useJUnitResult'; interface IContext { - onJUnit(testId: string, runId: string): void; + onJUnit(testId: string, runId: number): void; onDefinition(resourceType: ResourceType, resourceId: string, version?: number): void; } @@ -48,7 +48,7 @@ const FileViewerModalProvider = ({children}: IProps) => { }); const onJUnit = useCallback( - async (testId: string, runId: string) => { + async (testId: string, runId: number) => { loadJUnit(testId, runId); setIsFileViewerOpen(true); setProps(propsMap.junit); diff --git a/web/src/components/PaginatedList/PaginatedList.tsx b/web/src/components/PaginatedList/PaginatedList.tsx index 76f318cf31..1951720260 100644 --- a/web/src/components/PaginatedList/PaginatedList.tsx +++ b/web/src/components/PaginatedList/PaginatedList.tsx @@ -19,7 +19,7 @@ interface IProps { } interface IId { - id: string; + id: string | number; } const PaginatedList = ({dataCy, itemComponent: ItemComponent, params, query}: IProps) => { diff --git a/web/src/components/RunActionsMenu/RunActionsMenu.tsx b/web/src/components/RunActionsMenu/RunActionsMenu.tsx index 0c37601ba5..ab6f20e06c 100644 --- a/web/src/components/RunActionsMenu/RunActionsMenu.tsx +++ b/web/src/components/RunActionsMenu/RunActionsMenu.tsx @@ -9,11 +9,11 @@ import {ResourceType} from 'types/Resource.type'; import * as S from './RunActionsMenu.styled'; interface IProps { - resultId: string; + resultId: number; testId: string; isRunView?: boolean; testSuiteId?: string; - testSuiteRunId: string; + testSuiteRunId: number; } const RunActionsMenu = ({resultId, testId, testSuiteId, testSuiteRunId, isRunView = false}: IProps) => { diff --git a/web/src/components/RunDetailLayout/RunDetailLayout.tsx b/web/src/components/RunDetailLayout/RunDetailLayout.tsx index 163d4b1f44..00a0d02918 100644 --- a/web/src/components/RunDetailLayout/RunDetailLayout.tsx +++ b/web/src/components/RunDetailLayout/RunDetailLayout.tsx @@ -28,7 +28,7 @@ const renderTabBar: TabsProps['renderTabBar'] = (props, DefaultTabBar) => ( ); -const renderTab = (title: string, testId: string, runId: string, mode: string) => ( +const renderTab = (title: string, testId: string, runId: number, mode: string) => ( {title} diff --git a/web/src/components/RunDetailTrace/Search.tsx b/web/src/components/RunDetailTrace/Search.tsx index bd7dc3eead..c823de28a5 100644 --- a/web/src/components/RunDetailTrace/Search.tsx +++ b/web/src/components/RunDetailTrace/Search.tsx @@ -17,7 +17,7 @@ import * as S from './RunDetailTrace.styled'; const {useLazyGetSelectedSpansQuery} = TracetestAPI.instance; interface IProps { - runId: string; + runId: number; testId: string; } diff --git a/web/src/components/RunDetailTriggerResponse/RunDetailTriggerResponseFactory.tsx b/web/src/components/RunDetailTriggerResponse/RunDetailTriggerResponseFactory.tsx index 1075f82a2e..4b30c5ea5d 100644 --- a/web/src/components/RunDetailTriggerResponse/RunDetailTriggerResponseFactory.tsx +++ b/web/src/components/RunDetailTriggerResponse/RunDetailTriggerResponseFactory.tsx @@ -5,7 +5,7 @@ import RunDetailTriggerData from './RunDetailTriggerData'; import RunDetailTriggerResponse from './RunDetailTriggerResponse'; export interface IPropsComponent { - runId: string; + runId: number; state: TTestRunState; testId: string; triggerResult?: TriggerResult; diff --git a/web/src/components/TestOutputForm/SelectorInput.tsx b/web/src/components/TestOutputForm/SelectorInput.tsx index 379305157f..1904d7b23d 100644 --- a/web/src/components/TestOutputForm/SelectorInput.tsx +++ b/web/src/components/TestOutputForm/SelectorInput.tsx @@ -7,7 +7,7 @@ import TestOutput from 'models/TestOutput.model'; interface IProps { form: FormInstance; - runId: string; + runId: number; spanIdList: string[]; testId: string; } diff --git a/web/src/components/TestOutputForm/TestOutputForm.tsx b/web/src/components/TestOutputForm/TestOutputForm.tsx index 2621969784..b00012a505 100644 --- a/web/src/components/TestOutputForm/TestOutputForm.tsx +++ b/web/src/components/TestOutputForm/TestOutputForm.tsx @@ -23,7 +23,7 @@ interface IProps { onValidate(_: any, output: TestOutput): void; isValid: boolean; output?: TestOutput; - runId: string; + runId: number; testId: string; } diff --git a/web/src/components/TestSpecDetail/Assertion.tsx b/web/src/components/TestSpecDetail/Assertion.tsx index 140bad932b..e6040995c9 100644 --- a/web/src/components/TestSpecDetail/Assertion.tsx +++ b/web/src/components/TestSpecDetail/Assertion.tsx @@ -10,7 +10,7 @@ import * as S from './TestSpecDetail.styled'; interface IProps { check: ICheckResult; testId: string; - runId: string; + runId: number; selector: string; } diff --git a/web/src/components/TestSpecForm/AssertionCheck.tsx b/web/src/components/TestSpecForm/AssertionCheck.tsx index c28cd284a2..4162a7a650 100644 --- a/web/src/components/TestSpecForm/AssertionCheck.tsx +++ b/web/src/components/TestSpecForm/AssertionCheck.tsx @@ -24,7 +24,7 @@ interface IProps { field: Pick; name: number; attributeList: TSpanFlatAttribute[]; - runId: string; + runId: number; testId: string; spanIdList: string[]; } diff --git a/web/src/components/TestSpecForm/AssertionCheckList.tsx b/web/src/components/TestSpecForm/AssertionCheckList.tsx index 985b9b1b54..f4e6317c32 100644 --- a/web/src/components/TestSpecForm/AssertionCheckList.tsx +++ b/web/src/components/TestSpecForm/AssertionCheckList.tsx @@ -14,7 +14,7 @@ interface IProps { fields: FormListFieldData[]; form: FormInstance; remove(name: number): void; - runId: string; + runId: number; testId: string; spanIdList: string[]; } diff --git a/web/src/components/TestSpecForm/SelectorInput.tsx b/web/src/components/TestSpecForm/SelectorInput.tsx index 7deab3be04..1601391bbb 100644 --- a/web/src/components/TestSpecForm/SelectorInput.tsx +++ b/web/src/components/TestSpecForm/SelectorInput.tsx @@ -8,7 +8,7 @@ import {IValues} from './TestSpecForm'; interface IProps { form: FormInstance; testId: string; - runId: string; + runId: number; onValidSelector(isValid: boolean): void; } diff --git a/web/src/components/TestSpecForm/TestSpecForm.tsx b/web/src/components/TestSpecForm/TestSpecForm.tsx index 61649a9876..6e458bcb42 100644 --- a/web/src/components/TestSpecForm/TestSpecForm.tsx +++ b/web/src/components/TestSpecForm/TestSpecForm.tsx @@ -34,7 +34,7 @@ interface IProps { onSubmit(values: IValues): void; isValid: boolean; onIsValid(isValid: boolean): void; - runId: string; + runId: number; testId: string; } diff --git a/web/src/components/TestSpecForm/__tests__/TestSpecForm.test.tsx b/web/src/components/TestSpecForm/__tests__/TestSpecForm.test.tsx index 11ab3bbfab..d3806b5814 100644 --- a/web/src/components/TestSpecForm/__tests__/TestSpecForm.test.tsx +++ b/web/src/components/TestSpecForm/__tests__/TestSpecForm.test.tsx @@ -8,7 +8,7 @@ const defaultProps = { onClearSelectorSuggestions: jest.fn(), onClickPrevSelector: jest.fn(), testId: 'testId', - runId: 'runId', + runId: 1, isValid: false, onIsValid: jest.fn(), }; diff --git a/web/src/components/TestSpecForm/hooks/useQuerySelector.ts b/web/src/components/TestSpecForm/hooks/useQuerySelector.ts index eda03c7dd1..e5df4a9c2c 100644 --- a/web/src/components/TestSpecForm/hooks/useQuerySelector.ts +++ b/web/src/components/TestSpecForm/hooks/useQuerySelector.ts @@ -15,13 +15,13 @@ import {IValues} from '../TestSpecForm'; interface IDebounceProps { q: string; - rId: string; + rId: number; tId: string; } interface IProps { form: FormInstance; - runId: string; + runId: number; testId: string; onValidSelector(isValid: boolean): void; } diff --git a/web/src/components/TestSuiteRunActionsMenu/TestSuiteRunActionsMenu.tsx b/web/src/components/TestSuiteRunActionsMenu/TestSuiteRunActionsMenu.tsx index ae04bcfa19..ed31e7464e 100644 --- a/web/src/components/TestSuiteRunActionsMenu/TestSuiteRunActionsMenu.tsx +++ b/web/src/components/TestSuiteRunActionsMenu/TestSuiteRunActionsMenu.tsx @@ -7,7 +7,7 @@ import {ResourceType} from 'types/Resource.type'; import * as S from './TestSuiteRunActionsMenu.styled'; interface IProps { - runId: string; + runId: number; testSuiteId: string; isRunView?: boolean; } diff --git a/web/src/components/TestSuiteRunLayout/TestSuiteRunLayout.tsx b/web/src/components/TestSuiteRunLayout/TestSuiteRunLayout.tsx index 9fc44bdeca..4102253882 100644 --- a/web/src/components/TestSuiteRunLayout/TestSuiteRunLayout.tsx +++ b/web/src/components/TestSuiteRunLayout/TestSuiteRunLayout.tsx @@ -7,10 +7,10 @@ interface IProps { } const TestSuiteRunLayout = ({children}: IProps) => { - const {testSuiteId = '', runId = ''} = useParams(); + const {testSuiteId = '', runId = 0} = useParams(); return ( - + {children} diff --git a/web/src/components/Visualization/components/DAG/BaseSpanNode/BaseSpanNode.tsx b/web/src/components/Visualization/components/DAG/BaseSpanNode/BaseSpanNode.tsx index 7d8276d111..17c96b2287 100644 --- a/web/src/components/Visualization/components/DAG/BaseSpanNode/BaseSpanNode.tsx +++ b/web/src/components/Visualization/components/DAG/BaseSpanNode/BaseSpanNode.tsx @@ -15,42 +15,44 @@ interface IProps { span: Span; } -const BaseSpanNode = ({className, footer, id, isMatched, isSelected, span}: IProps) => ( - - - - - - - - - - {span.name} - - - - - - - {span.service} {SpanKindToText[span.kind]} - - - {Boolean(span.system) && ( +const BaseSpanNode = ({className, footer, id, isMatched, isSelected, span}: IProps) => { + return ( + + + + + + + + + + {span.name} + + + - - {span.system} + + + {span.service} {SpanKindToText[span.kind]} + - )} - - - {span.duration} - - - - {footer} - - - -); + {Boolean(span.system) && ( + + + {span.system} + + )} + + + {span.duration} + + + + {footer} + + + + ); +}; export default BaseSpanNode; diff --git a/web/src/gateways/TestRun.gateway.ts b/web/src/gateways/TestRun.gateway.ts index 7448d101dd..8cbb29935a 100644 --- a/web/src/gateways/TestRun.gateway.ts +++ b/web/src/gateways/TestRun.gateway.ts @@ -6,13 +6,13 @@ const TestRunGateway = () => ({ get(testId: string, take = 25, skip = 0) { return TracetestAPI.instance.endpoints.getRunList.initiate({testId, take, skip}); }, - getById(testId: string, runId: string) { + getById(testId: string, runId: number) { return TracetestAPI.instance.endpoints.getRunById.initiate({testId, runId}); }, - reRun(testId: string, runId: string) { + reRun(testId: string, runId: number) { return TracetestAPI.instance.endpoints.reRun.initiate({testId, runId}); }, - dryRun(testId: string, runId: string, testDefinition: Partial) { + dryRun(testId: string, runId: number, testDefinition: Partial) { return TracetestAPI.instance.endpoints.dryRun.initiate({testId, runId, testDefinition}); }, runTest(testId: string, variableSetId = '') { diff --git a/web/src/hooks/useDeleteResourceRun.tsx b/web/src/hooks/useDeleteResourceRun.tsx index e35770326a..88a6926a39 100644 --- a/web/src/hooks/useDeleteResourceRun.tsx +++ b/web/src/hooks/useDeleteResourceRun.tsx @@ -21,7 +21,7 @@ const useDeleteResourceRun = ({id, isRunView = false, type}: IProps) => { const {onOpen} = useConfirmationModal(); const onConfirmDelete = useCallback( - (runId: string) => { + (runId: number) => { if (type === ResourceType.Test) { TestAnalyticsService.onDeleteTestRun(); deleteTestRunById({testId: id, runId}); @@ -35,7 +35,7 @@ const useDeleteResourceRun = ({id, isRunView = false, type}: IProps) => { ); return useCallback( - (runId: string) => { + (runId: number) => { onOpen({ title: `Are you sure you want to delete the Run?`, onConfirm: () => onConfirmDelete(runId), diff --git a/web/src/hooks/useJUnitResult.ts b/web/src/hooks/useJUnitResult.ts index d2641fb338..597d77fd17 100644 --- a/web/src/hooks/useJUnitResult.ts +++ b/web/src/hooks/useJUnitResult.ts @@ -8,7 +8,7 @@ const useJUnitResult = () => { const [jUnit, setJUnit] = useState(''); const loadJUnit = useCallback( - async (testId: string, runId: string) => { + async (testId: string, runId: number) => { const data = await getJUnit({runId, testId}).unwrap(); setJUnit(data); diff --git a/web/src/models/TestRun.model.ts b/web/src/models/TestRun.model.ts index 7c434953b0..7d1d23e54f 100644 --- a/web/src/models/TestRun.model.ts +++ b/web/src/models/TestRun.model.ts @@ -34,6 +34,7 @@ type TestRun = Model< state: TTestRunState; linter: LinterResult; requiredGatesResult: RequiredGatesResult; + testSuiteRunId: number; } >; @@ -91,7 +92,7 @@ export function isRunStateAnalyzingError(state: TTestRunState) { } const TestRun = ({ - id = '', + id = 0, traceId = '', spanId = '', state = 'CREATED', @@ -111,7 +112,7 @@ const TestRun = ({ outputs = [], variableSet = {}, testSuiteId = '', - testSuiteRunId = '', + testSuiteRunId = 0, linter = {}, requiredGatesResult = {required: [], failed: [], passed: true}, }: TRawTestRun): TestRun => { @@ -139,7 +140,7 @@ const TestRun = ({ outputs: outputs?.map(rawOutput => TestRunOutput(rawOutput)), variableSet: VariableSet.fromRun(variableSet), testSuiteId, - testSuiteRunId, + testSuiteRunId: testSuiteRunId ? Number(testSuiteRunId) : 0, linter: LinterResult(linter), requiredGatesResult: RequiredGatesResult(requiredGatesResult), }; diff --git a/web/src/models/TestSuiteRun.model.ts b/web/src/models/TestSuiteRun.model.ts index 1ec88581a7..379a55f776 100644 --- a/web/src/models/TestSuiteRun.model.ts +++ b/web/src/models/TestSuiteRun.model.ts @@ -13,7 +13,7 @@ type TestSuiteRun = Model< >; const TestSuiteRun = ({ - id = '', + id = 0, createdAt = '', completedAt = '', state = 'CREATED', diff --git a/web/src/models/__mocks__/TestRun.mock.ts b/web/src/models/__mocks__/TestRun.mock.ts index dea8ecfc09..c0e448356a 100644 --- a/web/src/models/__mocks__/TestRun.mock.ts +++ b/web/src/models/__mocks__/TestRun.mock.ts @@ -8,7 +8,7 @@ import TraceMock from './Trace.mock'; const TestRunMock: IMockFactory = () => ({ raw(data = {}) { return { - id: faker.datatype.uuid(), + id: faker.datatype.number(), traceId: faker.datatype.uuid(), spanId: faker.datatype.uuid(), createdAt: faker.date.past().toISOString(), diff --git a/web/src/pages/RunDetail/RunDetail.tsx b/web/src/pages/RunDetail/RunDetail.tsx index daf36f88a5..e4dc172c16 100644 --- a/web/src/pages/RunDetail/RunDetail.tsx +++ b/web/src/pages/RunDetail/RunDetail.tsx @@ -10,15 +10,15 @@ import TestRunProvider from 'providers/TestRun'; import Content from './Content'; const RunDetail = () => { - const {testId = '', runId = ''} = useParams(); + const {testId = '', runId = 0} = useParams(); return ( - - + + - + diff --git a/web/src/providers/Span/Span.provider.tsx b/web/src/providers/Span/Span.provider.tsx index f84b054f97..fd9957b4fc 100644 --- a/web/src/providers/Span/Span.provider.tsx +++ b/web/src/providers/Span/Span.provider.tsx @@ -22,7 +22,7 @@ interface IContext { onSelectSpan(spanId: string): void; onSetMatchedSpans(spanIdList: string[]): void; onSetFocusedSpan(spanId: string): void; - onTriggerSelector(query: string, testId: string, runId: string): void; + onTriggerSelector(query: string, testId: string, runId: number): void; onClearMatchedSpans(): void; onClearSelectedSpan(): void; } @@ -82,7 +82,7 @@ const SpanProvider = ({children}: IProps) => { ); const onTriggerSelector = useCallback( - async (query: string, testId: string, runId: string) => { + async (query: string, testId: string, runId: number) => { const {spanIds = []} = await triggerSelector({ query, testId, diff --git a/web/src/providers/TestOutput/TestOutput.provider.tsx b/web/src/providers/TestOutput/TestOutput.provider.tsx index d76a092479..06894b8eba 100644 --- a/web/src/providers/TestOutput/TestOutput.provider.tsx +++ b/web/src/providers/TestOutput/TestOutput.provider.tsx @@ -64,7 +64,7 @@ export const Context = createContext({ interface IProps { children: React.ReactNode; - runId: string; + runId: number; testId: string; } diff --git a/web/src/providers/TestRun/TestRun.provider.tsx b/web/src/providers/TestRun/TestRun.provider.tsx index f156571a00..0a8814d597 100644 --- a/web/src/providers/TestRun/TestRun.provider.tsx +++ b/web/src/providers/TestRun/TestRun.provider.tsx @@ -26,7 +26,7 @@ export const Context = createContext({ interface IProps { testId: string; - runId?: string; + runId?: number; children: React.ReactNode; } @@ -34,7 +34,7 @@ export const useTestRun = () => useContext(Context); const POLLING_INTERVAL = 5000; -const TestRunProvider = ({children, testId, runId = ''}: IProps) => { +const TestRunProvider = ({children, testId, runId = 0}: IProps) => { const [pollingInterval, setPollingInterval] = useState(POLLING_INTERVAL); const {data: run, isError} = useGetRunByIdQuery({testId, runId}, {skip: !runId, pollingInterval}); const {data: runEvents = []} = useGetRunEventsQuery({testId, runId}, {skip: !runId}); diff --git a/web/src/providers/TestSpecs/TestSpecs.provider.tsx b/web/src/providers/TestSpecs/TestSpecs.provider.tsx index 9c032beb0b..42e8fe4420 100644 --- a/web/src/providers/TestSpecs/TestSpecs.provider.tsx +++ b/web/src/providers/TestSpecs/TestSpecs.provider.tsx @@ -50,7 +50,7 @@ export const Context = createContext({ interface IProps { testId: string; - runId: string; + runId: number; children: React.ReactNode; } diff --git a/web/src/providers/TestSpecs/__tests__/TestSpecs.provider.test.tsx b/web/src/providers/TestSpecs/__tests__/TestSpecs.provider.test.tsx index 164424ac67..f5f866ded6 100644 --- a/web/src/providers/TestSpecs/__tests__/TestSpecs.provider.test.tsx +++ b/web/src/providers/TestSpecs/__tests__/TestSpecs.provider.test.tsx @@ -4,7 +4,7 @@ import TestSpecs from '../TestSpecs.provider'; describe('TestDefinitionProvider', () => { it('should render with the proper values', () => { const {getByText} = render( - +

Hello

diff --git a/web/src/providers/TestSpecs/hooks/useTestSpecsCrud.ts b/web/src/providers/TestSpecs/hooks/useTestSpecsCrud.ts index 8ba59d7164..38097a9721 100644 --- a/web/src/providers/TestSpecs/hooks/useTestSpecsCrud.ts +++ b/web/src/providers/TestSpecs/hooks/useTestSpecsCrud.ts @@ -26,7 +26,7 @@ import { import {ISuggestion} from 'types/TestSpecs.types'; interface IProps { - runId: string; + runId: number; testId: string; test: Test; isDraftMode: boolean; diff --git a/web/src/providers/TestSuite/TestSuite.provider.tsx b/web/src/providers/TestSuite/TestSuite.provider.tsx index 43cc5a2817..39e95e8c1c 100644 --- a/web/src/providers/TestSuite/TestSuite.provider.tsx +++ b/web/src/providers/TestSuite/TestSuite.provider.tsx @@ -19,7 +19,7 @@ interface IContext { isEditLoading: boolean; onDelete(id: string, name: string): void; onEdit(draft: TDraftTestSuite): void; - onRun(runId?: string): void; + onRun(runId?: number): void; testSuite: TestSuite; latestTestSuite: TestSuite; } @@ -65,7 +65,7 @@ const TestSuiteProvider = ({children, testSuiteId, version = 0}: IProps) => { const {navigate} = useDashboard(); const onRun = useCallback( - (runId?: string) => { + (runId?: number) => { if (isLatestVersion) runTestSuite(testSuite!, runId); else { setAction('run'); diff --git a/web/src/providers/TestSuite/hooks/useTestSuiteCrud.ts b/web/src/providers/TestSuite/hooks/useTestSuiteCrud.ts index aeb952900b..73493080cc 100644 --- a/web/src/providers/TestSuite/hooks/useTestSuiteCrud.ts +++ b/web/src/providers/TestSuite/hooks/useTestSuiteCrud.ts @@ -27,7 +27,7 @@ const useTestSuiteCrud = () => { const {onOpen} = useMissingVariablesModal(); const runTestSuite = useCallback( - async (suite: TestSuite, runId?: string, variableSetId = selectedVariableSet?.id) => { + async (suite: TestSuite, runId?: number, variableSetId = selectedVariableSet?.id) => { const {fullSteps: testList} = await getTestSuite({ testSuiteId: suite.id, version: suite.version, diff --git a/web/src/providers/TestSuiteRun/TestSuite.provider.tsx b/web/src/providers/TestSuiteRun/TestSuite.provider.tsx index ce02acbd0f..1175c4d728 100644 --- a/web/src/providers/TestSuiteRun/TestSuite.provider.tsx +++ b/web/src/providers/TestSuiteRun/TestSuite.provider.tsx @@ -15,7 +15,7 @@ export const Context = createContext({ interface IProps { testSuiteId: string; - runId: string; + runId: number; children: React.ReactNode; } diff --git a/web/src/redux/actions/Router.actions.ts b/web/src/redux/actions/Router.actions.ts index adc086c38a..a7b195d36b 100644 --- a/web/src/redux/actions/Router.actions.ts +++ b/web/src/redux/actions/Router.actions.ts @@ -39,10 +39,10 @@ const RouterActions = () => ({ ), updateSelectedSpan: createAsyncThunk( 'router/updateSelectedSpan', - async ({params: {testId = '', runId = ''}, search}, {getState, dispatch}) => { + async ({params: {testId = '', runId = '0'}, search}, {getState, dispatch}) => { const {[RouterSearchFields.SelectedSpan]: spanId = ''} = search; const state = getState() as RootState; - const span = SpanSelectors.selectSpanById(state, String(spanId), testId, runId); + const span = SpanSelectors.selectSpanById(state, String(spanId), testId, Number(runId)); if (span) dispatch(setSelectedSpan({span})); } diff --git a/web/src/redux/actions/TestSpecs.actions.ts b/web/src/redux/actions/TestSpecs.actions.ts index 9548c1cba7..7d3dea5399 100644 --- a/web/src/redux/actions/TestSpecs.actions.ts +++ b/web/src/redux/actions/TestSpecs.actions.ts @@ -20,7 +20,7 @@ export type TChange = { }; const TestSpecsActions = () => ({ - publish: createAsyncThunk( + publish: createAsyncThunk( 'testDefinition/publish', async ({test, testId, runId}, {dispatch, getState}) => { const specs = TestSpecsSelectors.selectSpecs(getState() as RootState).filter(def => !def.isDeleted); @@ -30,7 +30,7 @@ const TestSpecsActions = () => ({ return dispatch(TestRunGateway.reRun(testId, runId)).unwrap(); } ), - dryRun: createAsyncThunk( + dryRun: createAsyncThunk( 'testDefinition/dryRun', ({definitionList, testId, runId}, {dispatch}) => { const specs = definitionList.map(def => TestDefinitionService.toRaw(def)); diff --git a/web/src/redux/actions/__tests_/TestSpecs.actions.test.ts b/web/src/redux/actions/__tests_/TestSpecs.actions.test.ts index 5d67005a02..d010e28668 100644 --- a/web/src/redux/actions/__tests_/TestSpecs.actions.test.ts +++ b/web/src/redux/actions/__tests_/TestSpecs.actions.test.ts @@ -27,7 +27,7 @@ describe('TestDefinitionActions', () => { TestSpecsActions.publish({ test: TestMock.model(), testId: 'testId', - runId: 'runId', + runId: 1, }) ); @@ -37,7 +37,7 @@ describe('TestDefinitionActions', () => { expect(setRequest.url).toEqual('http://localhost/api/tests/testId'); expect(setRequest.method).toEqual(HTTP_METHOD.PUT); - expect(reRunRequest.url).toEqual('http://localhost/api/tests/testId/run/runId/rerun'); + expect(reRunRequest.url).toEqual('http://localhost/api/tests/testId/run/1/rerun'); expect(reRunRequest.method).toEqual(HTTP_METHOD.POST); expect(fetchMock.mock.calls.length).toBe(2); @@ -52,14 +52,14 @@ describe('TestDefinitionActions', () => { await store.dispatch( TestSpecsActions.dryRun({ testId: 'testId', - runId: 'runId', + runId: 1, definitionList: [], }) ); const dryRunRequest = fetchMock.mock.calls[0][0] as Request; - expect(dryRunRequest.url).toEqual('http://localhost/api/tests/testId/run/runId/dry-run'); + expect(dryRunRequest.url).toEqual('http://localhost/api/tests/testId/run/1/dry-run'); expect(dryRunRequest.method).toEqual(HTTP_METHOD.PUT); expect(fetchMock.mock.calls.length).toBe(1); diff --git a/web/src/redux/apis/Tracetest/endpoints/Expression.endpoint.ts b/web/src/redux/apis/Tracetest/endpoints/Expression.endpoint.ts index e97f42d25e..58f7560bc0 100644 --- a/web/src/redux/apis/Tracetest/endpoints/Expression.endpoint.ts +++ b/web/src/redux/apis/Tracetest/endpoints/Expression.endpoint.ts @@ -5,7 +5,7 @@ import { TTestApiEndpointBuilder } from '../Tracetest.api'; export const expressionEndpoints = (builder: TTestApiEndpointBuilder) => ({ parseExpression: builder.mutation({ - query: ({expression, context: {spanId = '', runId = '', variableSetId = '', testId = '', selector = ''} = {}}) => ({ + query: ({expression, context: {spanId = '', runId = 0, variableSetId = '', testId = '', selector = ''} = {}}) => ({ url: '/expressions/resolve', method: HTTP_METHOD.POST, body: { diff --git a/web/src/redux/apis/Tracetest/endpoints/TestRun.endpoint.ts b/web/src/redux/apis/Tracetest/endpoints/TestRun.endpoint.ts index f628f065cf..3dc27784b3 100644 --- a/web/src/redux/apis/Tracetest/endpoints/TestRun.endpoint.ts +++ b/web/src/redux/apis/Tracetest/endpoints/TestRun.endpoint.ts @@ -42,7 +42,7 @@ export const testRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ items: rawTestResultList.map(rawTestResult => TestRun(rawTestResult)), }), }), - getRunById: builder.query({ + getRunById: builder.query({ query: ({testId, runId}) => `/tests/${testId}/run/${runId}`, providesTags: result => (result ? [{type: TracetestApiTags.TEST_RUN, id: result?.id}] : []), transformResponse: (rawTestResult: TRawTestRun) => TestRun(rawTestResult), @@ -58,7 +58,7 @@ export const testRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ }); }, }), - reRun: builder.mutation({ + reRun: builder.mutation({ query: ({testId, runId}) => ({ url: `/tests/${testId}/run/${runId}/rerun`, method: HTTP_METHOD.POST, @@ -70,7 +70,7 @@ export const testRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ ], transformResponse: (rawTestRun: TRawTestRun) => TestRun(rawTestRun), }), - dryRun: builder.mutation}>({ + dryRun: builder.mutation}>({ query: ({testId, runId, testDefinition}) => ({ url: `/tests/${testId}/run/${runId}/dry-run`, method: HTTP_METHOD.PUT, @@ -78,7 +78,7 @@ export const testRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ }), transformResponse: (rawTestResults: TRawAssertionResults) => AssertionResults(rawTestResults), }), - deleteRunById: builder.mutation({ + deleteRunById: builder.mutation({ query: ({testId, runId}) => ({url: `/tests/${testId}/run/${runId}`, method: 'DELETE'}), invalidatesTags: (result, error, {testId}) => [ {type: TracetestApiTags.TEST_RUN}, @@ -86,25 +86,25 @@ export const testRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ {type: TracetestApiTags.RESOURCE, id: 'LIST'}, ], }), - stopRun: builder.mutation({ + stopRun: builder.mutation({ query: ({runId, testId}) => ({ url: `/tests/${testId}/run/${runId}/stop`, method: HTTP_METHOD.POST, }), }), - getJUnitByRunId: builder.query({ + getJUnitByRunId: builder.query({ query: ({testId, runId}) => ({url: `/tests/${testId}/run/${runId}/junit.xml`, responseHandler: 'text'}), providesTags: (result, error, {testId, runId}) => [ {type: TracetestApiTags.TEST_RUN, id: `${testId}-${runId}-junit`}, ], }), - getSelectedSpans: builder.query({ + getSelectedSpans: builder.query({ query: ({testId, runId, query}) => `/tests/${testId}/run/${runId}/select?query=${encodeURIComponent(query)}`, providesTags: (result, error, {query}) => (result ? [{type: TracetestApiTags.SPAN, id: `${query}-LIST`}] : []), transformResponse: (rawSpanList: TRawSelectedSpans) => SelectedSpans(rawSpanList), }), - getRunEvents: builder.query({ + getRunEvents: builder.query({ query: ({runId, testId}) => `/tests/${testId}/run/${runId}/events`, providesTags: [{type: TracetestApiTags.TEST_RUN, id: 'EVENTS'}], transformResponse: (rawTestRunEvent: TRawTestRunEvent[]) => rawTestRunEvent.map(event => TestRunEvent(event)), diff --git a/web/src/redux/apis/Tracetest/endpoints/TestSuiteRun.endpoint.ts b/web/src/redux/apis/Tracetest/endpoints/TestSuiteRun.endpoint.ts index ee6fb06873..b5371842ac 100644 --- a/web/src/redux/apis/Tracetest/endpoints/TestSuiteRun.endpoint.ts +++ b/web/src/redux/apis/Tracetest/endpoints/TestSuiteRun.endpoint.ts @@ -41,7 +41,7 @@ export const testSuiteRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ }), }), - getTestSuiteRunById: builder.query({ + getTestSuiteRunById: builder.query({ query: ({testSuiteId, runId}) => `/testsuites/${testSuiteId}/run/${runId}`, providesTags: result => [{type: TracetestApiTags.TESTSUITE_RUN, id: result?.id}], transformResponse: (raw: TRawTestSuiteRunResourceRun) => TestSuiteRun(raw), @@ -59,7 +59,7 @@ export const testSuiteRunEndpoints = (builder: TTestApiEndpointBuilder) => ({ }, }), - deleteTestSuiteRunById: builder.mutation({ + deleteTestSuiteRunById: builder.mutation({ query: ({testSuiteId, runId}) => ({ url: `/testsuites/${testSuiteId}/run/${runId}`, method: HTTP_METHOD.DELETE, diff --git a/web/src/selectors/Assertion.selectors.ts b/web/src/selectors/Assertion.selectors.ts index 441124dd75..7351d3a2c8 100644 --- a/web/src/selectors/Assertion.selectors.ts +++ b/web/src/selectors/Assertion.selectors.ts @@ -8,7 +8,7 @@ import {TSpanSelector} from '../types/Assertion.types'; import SpanSelectors from './Span.selectors'; const stateSelector = (state: RootState) => state; -const paramsSelector = (state: RootState, testId: string, runId: string, spanIdList: string[] = []) => ({ +const paramsSelector = (state: RootState, testId: string, runId: number, spanIdList: string[] = []) => ({ spanIdList, testId, runId, @@ -17,12 +17,12 @@ const paramsSelector = (state: RootState, testId: string, runId: string, spanIdL const currentSelectorListSelector = ( state: RootState, testId: string, - runId: string, + runId: number, spanIdList?: string[], currentSelectorList: TSpanSelector[] = [] ) => currentSelectorList.map(({key}) => key); -const attributeKeySelector = (state: RootState, testId: string, runId: string, spanIdList: string[], key: string) => +const attributeKeySelector = (state: RootState, testId: string, runId: number, spanIdList: string[], key: string) => key; const selectMatchedSpanList = createSelector(stateSelector, paramsSelector, (state, {spanIdList, testId, runId}) => { diff --git a/web/src/selectors/Span.selectors.ts b/web/src/selectors/Span.selectors.ts index 03ed1eef05..d1dc43f3ad 100644 --- a/web/src/selectors/Span.selectors.ts +++ b/web/src/selectors/Span.selectors.ts @@ -4,7 +4,7 @@ import TracetestAPI from 'redux/apis/Tracetest/Tracetest.api'; const spansStateSelector = (state: RootState) => state.spans; const stateSelector = (state: RootState) => state; -const paramsSelector = (state: RootState, spanId: string, testId: string, runId: string) => ({spanId, testId, runId}); +const paramsSelector = (state: RootState, spanId: string, testId: string, runId: number) => ({spanId, testId, runId}); const selectMatchedSpans = createSelector( spansStateSelector, diff --git a/web/src/selectors/TestRun.selectors.ts b/web/src/selectors/TestRun.selectors.ts index 255f7587eb..bcc50c2c24 100644 --- a/web/src/selectors/TestRun.selectors.ts +++ b/web/src/selectors/TestRun.selectors.ts @@ -6,9 +6,9 @@ import TracetestAPI from 'redux/apis/Tracetest'; import TestRunService from 'services/TestRun.service'; import {RootState} from '../redux/store'; -const selectParams = (state: RootState, params: {testId: string; runId: string; spanId: string}) => params; +const selectParams = (state: RootState, params: {testId: string; runId: number; spanId: string}) => params; -const selectTestRun = (state: RootState, params: {testId: string; runId: string; spanId: string}) => { +const selectTestRun = (state: RootState, params: {testId: string; runId: number; spanId: string}) => { const {data} = TracetestAPI.instance.endpoints.getRunById.select({testId: params.testId, runId: params.runId})(state); return data ?? TestRun({}); }; diff --git a/web/src/types/Generated.types.ts b/web/src/types/Generated.types.ts index dc12d79251..3fba1a6f1d 100644 --- a/web/src/types/Generated.types.ts +++ b/web/src/types/Generated.types.ts @@ -1414,7 +1414,7 @@ export interface external { }; ResolveContext: { testId?: string; - runId?: string; + runId?: number; spanId?: string; selector?: string; variableSetId?: string; @@ -1808,7 +1808,7 @@ export interface external { assertions?: string[]; }; TestRun: { - id?: string; + id?: number; traceId?: string; spanId?: string; /** @description Test version used when running this test run */ @@ -1860,7 +1860,7 @@ export interface external { requiredGatesResult?: external["testRunner.yaml"]["components"]["schemas"]["RequiredGatesResult"]; metadata?: { [key: string]: string }; testSuiteId?: string; - testSuiteRunId?: string; + testSuiteRunId?: number; }; RunInformation: { metadata?: { [key: string]: string } | null; @@ -1955,7 +1955,7 @@ export interface external { summary?: external["tests.yaml"]["components"]["schemas"]["TestSummary"]; }; TestSuiteRun: { - id?: string; + id?: number; version?: number; /** Format: date-time */ createdAt?: string;