-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore-remove-delete-tracing-backend
- Loading branch information
Showing
37 changed files
with
121 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,6 @@ components: | |
type: string | ||
enum: | ||
[ | ||
agent, | ||
jaeger, | ||
opensearch, | ||
tempo, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-- We are going to deprecate "no tracing mode" and "agent" tracing backends | ||
-- So we need to migrate all users to a valid trace backend. | ||
-- | ||
-- This means that all users using "no tracing mode" and "agent" tracing backends will become | ||
-- "otlp" tracing backends | ||
|
||
-- If there's an "agent" tracing backend, replace it with an "otlp" tracing backend instead | ||
UPDATE data_stores | ||
SET "name" = 'otlp', "type" = 'otlp', "values" = '{}'::jsonb | ||
from ( | ||
SELECT id, "type" FROM data_stores WHERE "type" = 'agent' | ||
) migration_target | ||
WHERE data_stores.id = migration_target.id; | ||
|
||
-- If there's no "current" tracing backend, add one for otlp. This ensures that if user is on | ||
-- "No tracing mode", it will be migrated to "OpenTelemetry". | ||
INSERT INTO | ||
data_stores (id, "name", "type", is_default, "values", created_at, tenant_id) | ||
VALUES ('current', 'otlp', 'otlp', true, '{}'::jsonb, now(), '') | ||
ON CONFLICT DO NOTHING; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
testing/cli-e2etest/testscenarios/datastore/delete_datastore_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package datastore | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/kubeshop/tracetest/testing/cli-e2etest/environment" | ||
"github.com/kubeshop/tracetest/testing/cli-e2etest/helpers" | ||
"github.com/kubeshop/tracetest/testing/cli-e2etest/testscenarios/types" | ||
"github.com/kubeshop/tracetest/testing/cli-e2etest/tracetestcli" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestDeleteDatastore(t *testing.T) { | ||
// instantiate require with testing helper | ||
require := require.New(t) | ||
|
||
// setup isolated e2e environment | ||
env := environment.CreateAndStart(t) | ||
defer env.Close(t) | ||
|
||
cliConfig := env.GetCLIConfigPath(t) | ||
|
||
// Given I am a Tracetest CLI user | ||
// And I have my server recently created | ||
|
||
// When I try to set up a new datastore | ||
// Then it should be applied with success | ||
dataStorePath := env.GetEnvironmentResourcePath(t, "data-store") | ||
|
||
result := tracetestcli.Exec(t, fmt.Sprintf("apply datastore --file %s", dataStorePath), tracetestcli.WithCLIConfig(cliConfig)) | ||
helpers.RequireExitCodeEqual(t, result, 0) | ||
|
||
// When I try to get a datastore | ||
// Then it should return the datastore applied on the last step | ||
result = tracetestcli.Exec(t, "get datastore --id current", tracetestcli.WithCLIConfig(cliConfig)) | ||
helpers.RequireExitCodeEqual(t, result, 0) | ||
|
||
dataStore := helpers.UnmarshalYAML[types.DataStoreResource](t, result.StdOut) | ||
require.Equal("DataStore", dataStore.Type) | ||
require.Equal("current", dataStore.Spec.ID) | ||
require.True(dataStore.Spec.Default) | ||
|
||
// When I try to delete the datastore | ||
// Then it should return a error message, showing that we cannot delete a datastore | ||
result = tracetestcli.Exec(t, "delete datastore --id current", tracetestcli.WithCLIConfig(cliConfig)) | ||
helpers.RequireExitCodeEqual(t, result, 1) | ||
require.Contains(result.StdErr, "resource DataStore does not support the action") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.