Skip to content

Conversation

@anusudarsan
Copy link
Member

@anusudarsan anusudarsan commented Nov 27, 2024

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

optional) We could add a helper class implementing TemporaryRelation:

    public static class TestKeyspace
            implements TemporaryRelation
    {
        private final CassandraSession session;
        private final String name;

        public TestKeyspace(CassandraSession session, String namePrefix)
        {
            this.session = requireNonNull(session, "session is null");
            this.name = namePrefix + "_" + randomNameSuffix();
            session.execute("CREATE KEYSPACE IF NOT EXISTS " + name + " WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor': 1}");
        }

        @Override
        public String getName()
        {
            return name;
        }

        @Override
        public void close()
        {
            session.execute("DROP KEYSPACE IF EXISTS " + name);
        }
    }

@anusudarsan
Copy link
Member Author

optional) We could add a helper class implementing TemporaryRelation:

the create and drop does not seem to be executed on the "name". for e.g testUpperCaseNameUnescapedInCassandra uses upper case to create and lowercase to drop. Looks like these actions are case sensitive. So I guess I will skip this suggestion

Co-authored by: Mayank Vadariya <48036907+mayankvadariya@users.noreply.github.com>
@anusudarsan anusudarsan force-pushed the anu/cassandra-test-refactor branch from f0835e3 to 6967c8d Compare December 2, 2024 21:41
Randomize to run tests outside of non-dockerized env (like AstraDB) and avoid conflicts

Co-authored by: Mayank Vadariya <48036907+mayankvadariya@users.noreply.github.com>
@ebyhr ebyhr force-pushed the anu/cassandra-test-refactor branch from 6967c8d to dd0075c Compare December 2, 2024 22:44
@ebyhr ebyhr merged commit 04da50c into trinodb:master Dec 2, 2024
6 of 13 checks passed
@github-actions github-actions bot added this to the 467 milestone Dec 2, 2024
@anusudarsan anusudarsan deleted the anu/cassandra-test-refactor branch December 2, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants