Skip to content

Commit

Permalink
Merge branch 'main' into fix/cli-cloud-cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Sep 11, 2023
2 parents f04fb5a + 7729669 commit 292d851
Show file tree
Hide file tree
Showing 115 changed files with 742 additions and 571 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -348,14 +352,17 @@ 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
export TRACETEST_CLI=$PWD/dist/tracetest
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
Expand Down
2 changes: 1 addition & 1 deletion agent/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ components:
type: string
description: resource ID
runId:
type: string
type: integer
description: run ID
type:
type: string
Expand Down
2 changes: 1 addition & 1 deletion api/expressions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ components:
testId:
type: string
runId:
type: string
type: integer
spanId:
type: string
selector:
Expand Down
4 changes: 2 additions & 2 deletions api/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ components:
type: object
properties:
id:
type: string
type: integer
readOnly: true
traceId:
type: string
Expand Down Expand Up @@ -230,7 +230,7 @@ components:
testSuiteId:
type: string
testSuiteRunId:
type: string
type: integer

RunInformation:
type: object
Expand Down
2 changes: 1 addition & 1 deletion api/testsuites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ components:
type: object
properties:
id:
type: string
type: integer
readOnly: true
version:
type: integer
Expand Down
4 changes: 2 additions & 2 deletions cli/formatters/test_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions cli/formatters/test_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions cli/formatters/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions cli/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 292d851

Please sign in to comment.