Skip to content

Commit

Permalink
fixup! feat(e2e): add e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeqo committed Sep 1, 2023
1 parent f925e0e commit 5c7e674
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,16 @@ final var record = createProducerRecord(
}

private static List<File> localLogFiles(final TopicPartition tp) {
return localPartitionFiles(tp)
.filter(f -> f.getName().endsWith(".log"))
.collect(Collectors.toList());
final Path dir = localDataDir.resolve(String.format("%s-%d", tp.topic(), tp.partition()));
try (final var paths = Files.list(dir)) {
return paths
.map(Path::toFile)
.sorted(Comparator.comparing(File::getName))
.filter(f -> f.getName().endsWith(".log"))
.collect(Collectors.toList());
} catch (final IOException e) {
throw new RuntimeException(e);
}
}

@Test
Expand Down Expand Up @@ -580,17 +587,6 @@ private void checkRecord(final ConsumerRecord<byte[], byte[]> actual,
assertThat(actual.value()).isEqualTo(expected.value());
}

private static Stream<File> localPartitionFiles(final TopicPartition tp) {
final Path dir = localDataDir.resolve(String.format("%s-%d", tp.topic(), tp.partition()));
try (final var paths = Files.list(dir)) {
return paths
.map(Path::toFile)
.sorted(Comparator.comparing(File::getName));
} catch (final IOException e) {
throw new RuntimeException(e);
}
}

abstract List<String> remotePartitionFiles(final TopicIdPartition topicIdPartition);

abstract boolean assertNoTopicDataOnTierStorage(final String topicName, final Uuid topicId);
Expand Down

0 comments on commit 5c7e674

Please sign in to comment.