Skip to content

Commit 924d122

Browse files
committed
CNDB-14343: Parameterize VectorColumnPositionsTest to test all relevant index versions
1 parent 4fa17fb commit 924d122

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/unit/org/apache/cassandra/index/sai/cql/VectorColumnPositionsTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,42 @@
1616

1717
package org.apache.cassandra.index.sai.cql;
1818

19+
import java.util.Collection;
20+
import java.util.stream.Collectors;
21+
22+
import org.junit.Before;
1923
import org.junit.Test;
24+
import org.junit.runner.RunWith;
25+
import org.junit.runners.Parameterized;
26+
27+
import org.apache.cassandra.index.sai.SAIUtil;
28+
import org.apache.cassandra.index.sai.disk.format.Version;
2029

2130
/**
2231
* Tests vector indexes in different column positions (partition key, clustering key, static and regular columns).
2332
*/
33+
@RunWith(Parameterized.class)
2434
public class VectorColumnPositionsTest extends VectorTester
2535
{
36+
@Parameterized.Parameter
37+
public Version version;
38+
39+
@Parameterized.Parameters(name = "{0}")
40+
public static Collection<Object[]> data()
41+
{
42+
return Version.ALL.stream()
43+
.filter(v -> v.onOrAfter(Version.JVECTOR_EARLIEST))
44+
.sorted()
45+
.map(v -> new Object[]{ v})
46+
.collect(Collectors.toList());
47+
}
48+
49+
@Before
50+
public void setupVersion()
51+
{
52+
SAIUtil.setCurrentVersion(version);
53+
}
54+
2655
@Test
2756
public void testPartitionKey()
2857
{

0 commit comments

Comments
 (0)