Skip to content

feat(testcontainers): refactor vshard and cartridge testcontainers#64

Merged
Alex-pvl merged 2 commits intomasterfrom
crud_tests_refactor
Apr 6, 2026
Merged

feat(testcontainers): refactor vshard and cartridge testcontainers#64
Alex-pvl merged 2 commits intomasterfrom
crud_tests_refactor

Conversation

@Alex-pvl
Copy link
Copy Markdown
Contributor

@Alex-pvl Alex-pvl commented Apr 1, 2026

I haven't forgotten about:

  • Tests
  • Changelog
  • Documentation
    • JavaDoc was written
  • Commit messages comply with the guideline
  • Cleanup the code for review. See checklist

Related issues:

@Alex-pvl Alex-pvl force-pushed the crud_tests_refactor branch 12 times, most recently from 8da9e80 to b3bed3d Compare April 3, 2026 06:57
@Alex-pvl Alex-pvl marked this pull request as ready for review April 3, 2026 06:58
@Alex-pvl Alex-pvl self-assigned this Apr 3, 2026
@Alex-pvl Alex-pvl requested a review from nickkkccc April 3, 2026 06:58
Comment on lines +487 to +510
protected String getFileName(String filePath) {
if (filePath == null || filePath.isEmpty()) {
throw new IllegalArgumentException("File path must not be null or empty");
}
int idx = filePath.lastIndexOf('/');
return idx >= 0 ? filePath.substring(idx + 1) : filePath;
}

private List<String> parseInstanceNames(String instancesPath) {
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(instancesPath)) {
if (inputStream == null) {
throw new IllegalArgumentException(
String.format("No resource path found for the specified resource %s", instancesPath));
}
Object parsed = new Yaml().load(inputStream);
if (!(parsed instanceof Map<?, ?>)) {
return Collections.emptyList();
}
return ((Map<?, ?>) parsed)
.keySet().stream().map(String::valueOf).collect(Collectors.toList());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Лучше вообще убрать Yaml зависимость, более эффективно использовать Jackson.

Для путей и директорий лучше всегда использовать Path, начиная с Java 8

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Убрал

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Почему решил не использовать org.testcontainers.containers.tarantool.config.ConfigurationUtils, в котором есть уже удобные методы для работы с конфигурацией Tarantool 3.x?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Переделал

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Идея была сделать единообразный интерфейс взаимодействия с кластером тестовым посредством конфигураторов (пример таких - TDGConfigurator). И чтобы контейнеры имели один и тот же API

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Добавил конфигураторы

import org.testcontainers.containers.utils.SslContext;
import org.testcontainers.containers.utils.TarantoolContainerClientHelper;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.yaml.snakeyaml.Yaml;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Нужно использовать Jackson

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Готово

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Кажется это не относится к этому МР

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Не, относится

@Alex-pvl Alex-pvl force-pushed the crud_tests_refactor branch 2 times, most recently from ce81b4e to ff598a9 Compare April 6, 2026 05:51
@Alex-pvl Alex-pvl force-pushed the crud_tests_refactor branch from ff598a9 to 3f29d9b Compare April 6, 2026 06:37
@Alex-pvl Alex-pvl requested a review from nickkkccc April 6, 2026 07:04
@Alex-pvl Alex-pvl merged commit 65b4e94 into master Apr 6, 2026
6 checks passed
@Alex-pvl Alex-pvl deleted the crud_tests_refactor branch April 6, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants