Skip to content

Add integration tests analysis and TestContainers migration guide#201

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/analyze-integration-tests
Draft

Add integration tests analysis and TestContainers migration guide#201
Copilot wants to merge 6 commits intomainfrom
copilot/analyze-integration-tests

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Analyzed all 30 integration tests to identify TestContainers usage vs CSV-based configuration. Only 5 SQL Server tests (16.7%) use TestContainers; remaining 25 tests (83.3%) require external database setup via CSV files.

Documents Created

  • INTEGRATION_TESTS_QUICK_REFERENCE.md - Lookup table with all 30 tests, TestContainers status, migration priorities, and execution commands
  • INTEGRATION_TESTS_ANALYSIS.md - Detailed breakdown by database (Oracle: 7, PostgreSQL: 4, MySQL: 4, CockroachDB: 4, DB2: 4, H2: 5, MariaDB: ~2, Multinode: 2), benefits analysis, and migration recommendations
  • TESTCONTAINERS_MIGRATION_GUIDE.md - Step-by-step migration guide with code templates, database-specific instructions (PostgreSQL, MySQL, MariaDB, CockroachDB, Oracle, DB2), best practices from SQL Server implementation, and troubleshooting
  • analysis/README.md - Navigation guide for all analysis documents

Migration Priorities

High Priority (PostgreSQL, MySQL, MariaDB): 10 tests, excellent TestContainers support
Medium Priority (CockroachDB, Oracle): 11 tests, good support
Low Priority (DB2): 4 tests
Special Cases (H2, Multinode): 7 tests, not applicable (embedded DB, architecture tests)

Database Licensing Clarification

Documentation clarifies that all major commercial databases provide free editions for testing and development:

  • SQL Server Developer Edition - Free for development and testing (not production)
  • Oracle Database Free/XE - Free for development and testing (not production)
  • DB2 Community Edition - Free for development and testing (not production)

Only production use of these databases requires commercial licensing. TestContainers uses the free editions suitable for automated testing, making migration viable for all databases without licensing concerns.

Database-Specific Migration Guides Added

The migration guide now includes detailed implementation instructions for:

  • PostgreSQL
  • MySQL
  • MariaDB
  • CockroachDB
  • Oracle (with Oracle Free/XE licensing details)
  • DB2 (with Community Edition licensing details and .acceptLicense() requirement)

Key Patterns from SQL Server Implementation

// Singleton container manager
public class PostgreSQLTestContainer {
    private static PostgreSQLContainer<?> container;
    
    public static PostgreSQLContainer<?> getInstance() {
        if (container == null) {
            container = new PostgreSQLContainer<>("postgres:17-alpine").start();
        }
        return container;
    }
}

// JUnit ArgumentsProvider
public class PostgreSQLConnectionProvider implements ArgumentsProvider {
    public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
        String ojpUrl = "jdbc:ojp[localhost:1059]_" + 
            PostgreSQLTestContainer.getJdbcUrl().substring("jdbc:".length());
        return Stream.of(Arguments.of("org.openjproxy.jdbc.Driver", ojpUrl, ...));
    }
}

// Test usage
@EnabledIf("openjproxy.jdbc.testutil.PostgreSQLTestContainer#isEnabled")
public class PostgresMultipleTypesIntegrationTest {
    @ParameterizedTest
    @ArgumentsSource(PostgreSQLConnectionProvider.class)
    public void testMethod(String driverClass, String url, String user, String pwd) { ... }
}

Documentation added to documents/README.md under new Testing section.

Original prompt

Do a full analysis of our integration tests, the goal is to find and list all the ones that use test containers and all the ones that do not. also create a document with instructions on how to migrate integration tests to use containers.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 31, 2025 08:52
…tion guide

Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
Copilot AI changed the title [WIP] Analyze integration tests for container usage Add integration tests analysis and TestContainers migration guide Dec 31, 2025
Copilot AI requested a review from rrobetti December 31, 2025 08:56
@rrobetti
Copy link
Contributor

@copilot when you say Oracle requires license, are you sure? Research it better, I thought the Oracle images could be used freely for tests, just not for production work.

Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot when you say Oracle requires license, are you sure? Research it better, I thought the Oracle images could be used freely for tests, just not for production work.

You're absolutely right! I've corrected the documentation. Oracle Database Free (formerly Express Edition/XE) is indeed free to use for testing and development without any licensing requirements. Only production use of Oracle Database requires commercial licensing.

Updated all 4 documentation files to clarify:

  • Oracle Free/XE is free for testing ✅
  • TestContainers oracle-free module uses the free edition
  • Only production use requires commercial licensing

Changes in commit 804d31d

@rrobetti
Copy link
Contributor

@copilot also review DB2 and SQL Sever requirements for licences to use docker images, I believe they also provide the images free for tests but not for production. Review, research and confirm or correct this statement. Update documentation if required.

…sting

Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot also review DB2 and SQL Sever requirements for licences to use docker images, I believe they also provide the images free for tests but not for production. Review, research and confirm or cor...

Correct! I've researched and updated all documentation:

SQL Server Developer Edition - Free for testing/development (not production) ✅
DB2 Community Edition - Free for testing/development (not production) ✅

Updated all 4 documentation files:

  • Clarified both SQL Server and DB2 are free for testing
  • Added new "Database Licensing for Testing" section in migration guide
  • Added DB2 migration guide with Community Edition details
  • Added note about SQL Server Developer Edition in reference implementation

All three major commercial databases (SQL Server, Oracle, DB2) provide free editions for automated testing and development. Only production use requires licensing.

Changes in commit 181be3a

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