Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Remove dependency on ArchiveFactory #6156

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Cassandra Archive Integration Test
Signed-off-by: Mahad Zaryab <[email protected]>
mahadzaryab1 committed Nov 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c38541627851d01895a7eeed5c62f9c98b9afad1
26 changes: 22 additions & 4 deletions plugin/storage/integration/cassandra_test.go
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@ import (

type CassandraStorageIntegration struct {
StorageIntegration
factory *cassandra.Factory
factory *cassandra.Factory
archiveFactory *cassandra.Factory
}

func newCassandraStorageIntegration() *CassandraStorageIntegration {
@@ -38,11 +39,15 @@ func newCassandraStorageIntegration() *CassandraStorageIntegration {

func (s *CassandraStorageIntegration) cleanUp(t *testing.T) {
require.NoError(t, s.factory.Purge(context.Background()))
require.NoError(t, s.archiveFactory.Purge(context.Background()))
}

func (*CassandraStorageIntegration) initializeCassandraFactory(t *testing.T, flags []string) *cassandra.Factory {
func (*CassandraStorageIntegration) initializeCassandraFactory(
t *testing.T,
flags []string,
isArchive bool) *cassandra.Factory {
logger := zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller()))
f := cassandra.NewFactory(false)
f := cassandra.NewFactory(isArchive)
v, command := config.Viperize(f.AddFlags)
require.NoError(t, command.ParseFlags(flags))
f.InitFromViper(v, logger)
@@ -58,13 +63,26 @@ func (s *CassandraStorageIntegration) initializeCassandra(t *testing.T) {
"--cassandra.password=" + password,
"--cassandra.username=" + username,
"--cassandra.keyspace=jaeger_v1_dc1",
})
}, false)
af := s.initializeCassandraFactory(t, []string{
"--cassandra-archive.keyspace=jaeger_v1_dc1_archive",
"--cassandra-archive.enabled=true",
"--cassandra-archive.servers=127.0.0.1",
"--cassandra-archive.basic.allowed-authenticators=org.apache.cassandra.auth.PasswordAuthenticator",
"--cassandra-archive.password=" + password,
"--cassandra-archive.username=" + username,
}, true)
s.factory = f
s.archiveFactory = af
var err error
s.SpanWriter, err = f.CreateSpanWriter()
require.NoError(t, err)
s.SpanReader, err = f.CreateSpanReader()
require.NoError(t, err)
s.ArchiveSpanReader, err = af.CreateSpanReader()
require.NoError(t, err)
s.ArchiveSpanWriter, err = af.CreateSpanWriter()
require.NoError(t, err)
s.SamplingStore, err = f.CreateSamplingStore(0)
require.NoError(t, err)
s.initializeDependencyReaderAndWriter(t, f)
Loading