Skip to content

Commit

Permalink
Fix test issues
Browse files Browse the repository at this point in the history
Signed-off-by: John Mazanec <[email protected]>
  • Loading branch information
jmazanec15 committed Jan 5, 2023
1 parent ed0a642 commit d9df004
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ public void testBuildFromModelTemplate() throws InterruptedException, ExecutionE

// Ensure that the codec is able to return the correct per field knn vectors format for codec
public void testCodecSetsCustomPerFieldKnnVectorsFormat() {
final Codec codec = KNN940Codec.builder()
.delegate(V_9_4_0.getDefaultCodecDelegate())
.knnVectorsFormat(V_9_4_0.getPerFieldKnnVectorsFormat())
.build();

final Codec codec = new KNN940Codec();
assertTrue(codec.knnVectorsFormat() instanceof KNN940PerFieldKnnVectorsFormat);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.knn.index.codec.KNN940Codec.KNN940Codec;
import org.opensearch.knn.index.codec.KNN940Codec.KNN940PerFieldKnnVectorsFormat;
import org.opensearch.knn.index.codec.KNNCodecTestCase;

import java.util.Optional;
import java.util.function.Function;

import static org.opensearch.knn.index.codec.KNNCodecVersion.V_9_4_0;
import static org.opensearch.knn.index.codec.KNNCodecVersion.V_9_5_0;

public class KNN950CodecTests extends KNNCodecTestCase {
Expand All @@ -33,12 +30,8 @@ public void testBuildFromModelTemplate() {

// Ensure that the codec is able to return the correct per field knn vectors format for codec
public void testCodecSetsCustomPerFieldKnnVectorsFormat() {
final Codec codec = KNN940Codec.builder()
.delegate(V_9_4_0.getDefaultCodecDelegate())
.knnVectorsFormat(V_9_4_0.getPerFieldKnnVectorsFormat())
.build();

assertTrue(codec.knnVectorsFormat() instanceof KNN940PerFieldKnnVectorsFormat);
final Codec codec = new KNN950Codec();
assertTrue(codec.knnVectorsFormat() instanceof KNN950PerFieldKnnVectorsFormat);
}

// IMPORTANT: When this Codec is moved to a backwards Codec, this test needs to be removed, because it attempts to
Expand Down

0 comments on commit d9df004

Please sign in to comment.