Skip to content

Add JDBC URL option TC_COPY_FILE, copying files to container #6387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

larsmoil
Copy link

@larsmoil larsmoil commented Jan 4, 2023

This adds another option, TC_COPY_FILE, to the JDBC URL scheme. It enables one to copy files into the container image.

  • It can do single files: jdbc:tc:...?TC_COPY_FILE=relative-path/file:/container-path/the-file
  • You may also specify file mode: jdbc:tc:...?TC_COPY_FILE=relative-path/file:/container-path/the-file:755
  • You may also do multiple files: jdbc:tc:...?TC_COPY_FILE=relative-path/file:/container-path/the-file&TC_COPY_FILE=file:/absolute-path/another-file:/container-path/antoher-file:755

@@ -204,13 +205,13 @@ private HikariDataSource verifyCharacterSet(String jdbcUrl) throws SQLException
private void performTestForCustomIniFile(HikariDataSource dataSource) throws SQLException {
assumeFalse(SystemUtils.IS_OS_WINDOWS);
Statement statement = dataSource.getConnection().createStatement();
statement.execute("SELECT @@GLOBAL.innodb_file_format");
statement.execute("SELECT @@GLOBAL.key_buffer_size");
Copy link
Author

Choose a reason for hiding this comment

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

Barracuda was already the default value for innodb_file_format, thus not actually testing the config was applied. I doubled the value of key_buffer_size in the ini file and asserted based on that instead.

Copy link
Member

Choose a reason for hiding this comment

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

This might be the reason why the mariadb tests fail.

@kiview
Copy link
Member

kiview commented Jan 5, 2023

The mariadb module tests are failing on CI (https://github.com/testcontainers/testcontainers-java/actions/runs/3837940900/jobs/6550222122#step:6:293). The other failures are mostly because of a schedule brown-out, since we still use an old Ubuntu image version, I will trigger a re-run.

* Change the way file vs. classpath resources work
* Change the way we specify multiple files
…* Change the way file vs. classpath resources work * Change the way we specify multiple files
@eddumelendez eddumelendez changed the title Add JDBC URL option TC_COPY_FILES, copying files to container Add JDBC URL option TC_COPY_FILE, copying files to container Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants