From 61bfd3d769fb6556a37fbacb9e0b4772f78def4f Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 20 Aug 2024 10:52:53 +0200 Subject: [PATCH 01/33] Add Db2 module --- Directory.Packages.props | 1 + Testcontainers.sln | 209 ++++++++++-------- src/Testcontainers.Db2/.editorconfig | 1 + src/Testcontainers.Db2/Db2Builder.cs | 191 ++++++++++++++++ src/Testcontainers.Db2/Db2Configuration.cs | 96 ++++++++ src/Testcontainers.Db2/Db2Container.cs | 42 ++++ .../Testcontainers.Db2.csproj | 12 + src/Testcontainers.Db2/Usings.cs | 7 + tests/Testcontainers.Db2.Tests/.editorconfig | 1 + .../Db2ContainerTest.cs | 47 ++++ .../Testcontainers.Db2.Tests.csproj | 18 ++ tests/Testcontainers.Db2.Tests/Usings.cs | 5 + 12 files changed, 534 insertions(+), 96 deletions(-) create mode 100644 src/Testcontainers.Db2/.editorconfig create mode 100644 src/Testcontainers.Db2/Db2Builder.cs create mode 100644 src/Testcontainers.Db2/Db2Configuration.cs create mode 100644 src/Testcontainers.Db2/Db2Container.cs create mode 100644 src/Testcontainers.Db2/Testcontainers.Db2.csproj create mode 100644 src/Testcontainers.Db2/Usings.cs create mode 100644 tests/Testcontainers.Db2.Tests/.editorconfig create mode 100644 tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs create mode 100644 tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj create mode 100644 tests/Testcontainers.Db2.Tests/Usings.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 79222b5b3..f532da00e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,6 +35,7 @@ + diff --git a/Testcontainers.sln b/Testcontainers.sln index e8c10a811..24f806753 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -13,200 +13,201 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{673F23AE-769 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ActiveMq", "src\Testcontainers.ActiveMq\Testcontainers.ActiveMq.csproj", "{5365F780-0E6C-41F0-B1B9-7DC34368F80C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ActiveMq", "src\Testcontainers.ActiveMq\Testcontainers.ActiveMq.csproj", "{5365F780-0E6C-41F0-B1B9-7DC34368F80C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ArangoDb", "src\Testcontainers.ArangoDb\Testcontainers.ArangoDb.csproj", "{AB9C1563-07C7-4685-BACD-BB1FF64B3611}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ArangoDb", "src\Testcontainers.ArangoDb\Testcontainers.ArangoDb.csproj", "{AB9C1563-07C7-4685-BACD-BB1FF64B3611}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Azurite", "src\Testcontainers.Azurite\Testcontainers.Azurite.csproj", "{3F2E254F-C203-43FD-A078-DC3E2CBC0F9F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Azurite", "src\Testcontainers.Azurite\Testcontainers.Azurite.csproj", "{3F2E254F-C203-43FD-A078-DC3E2CBC0F9F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.BigQuery", "src\Testcontainers.BigQuery\Testcontainers.BigQuery.csproj", "{A9FF9C7F-BBA0-4B44-90B7-48A60F9E00F3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.BigQuery", "src\Testcontainers.BigQuery\Testcontainers.BigQuery.csproj", "{A9FF9C7F-BBA0-4B44-90B7-48A60F9E00F3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Bigtable", "src\Testcontainers.Bigtable\Testcontainers.Bigtable.csproj", "{302EC1E0-AE75-4E99-A6BF-524F35338BC8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Bigtable", "src\Testcontainers.Bigtable\Testcontainers.Bigtable.csproj", "{302EC1E0-AE75-4E99-A6BF-524F35338BC8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ClickHouse", "src\Testcontainers.ClickHouse\Testcontainers.ClickHouse.csproj", "{B061A78E-536E-4CA1-8401-234D5FBFBAB7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ClickHouse", "src\Testcontainers.ClickHouse\Testcontainers.ClickHouse.csproj", "{B061A78E-536E-4CA1-8401-234D5FBFBAB7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CockroachDb", "src\Testcontainers.CockroachDb\Testcontainers.CockroachDb.csproj", "{8D9871C6-5A39-4F0B-A15A-E87D34F3EA73}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CockroachDb", "src\Testcontainers.CockroachDb\Testcontainers.CockroachDb.csproj", "{8D9871C6-5A39-4F0B-A15A-E87D34F3EA73}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Consul", "src\Testcontainers.Consul\Testcontainers.Consul.csproj", "{51ED33B9-B688-401E-85F2-329D3C935BD1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Consul", "src\Testcontainers.Consul\Testcontainers.Consul.csproj", "{51ED33B9-B688-401E-85F2-329D3C935BD1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CosmosDb", "src\Testcontainers.CosmosDb\Testcontainers.CosmosDb.csproj", "{A724806F-8C94-4438-8011-04A9A1575318}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CosmosDb", "src\Testcontainers.CosmosDb\Testcontainers.CosmosDb.csproj", "{A724806F-8C94-4438-8011-04A9A1575318}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Couchbase", "src\Testcontainers.Couchbase\Testcontainers.Couchbase.csproj", "{58E94721-2681-4D82-8D94-0B2F9DB0D575}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Couchbase", "src\Testcontainers.Couchbase\Testcontainers.Couchbase.csproj", "{58E94721-2681-4D82-8D94-0B2F9DB0D575}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CouchDb", "src\Testcontainers.CouchDb\Testcontainers.CouchDb.csproj", "{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CouchDb", "src\Testcontainers.CouchDb\Testcontainers.CouchDb.csproj", "{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb", "src\Testcontainers.DynamoDb\Testcontainers.DynamoDb.csproj", "{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.DynamoDb", "src\Testcontainers.DynamoDb\Testcontainers.DynamoDb.csproj", "{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb", "src\Testcontainers.EventStoreDb\Testcontainers.EventStoreDb.csproj", "{84D707E0-C9FA-4327-85DC-0AFEBEA73572}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.EventStoreDb", "src\Testcontainers.EventStoreDb\Testcontainers.EventStoreDb.csproj", "{84D707E0-C9FA-4327-85DC-0AFEBEA73572}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FakeGcsServer", "src\Testcontainers.FakeGcsServer\Testcontainers.FakeGcsServer.csproj", "{FF86B509-2F9E-4269-ABC2-912B3339DE29}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FakeGcsServer", "src\Testcontainers.FakeGcsServer\Testcontainers.FakeGcsServer.csproj", "{FF86B509-2F9E-4269-ABC2-912B3339DE29}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FirebirdSql", "src\Testcontainers.FirebirdSql\Testcontainers.FirebirdSql.csproj", "{31BAF2C4-0608-4C0F-845A-14FE7C0A1670}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FirebirdSql", "src\Testcontainers.FirebirdSql\Testcontainers.FirebirdSql.csproj", "{31BAF2C4-0608-4C0F-845A-14FE7C0A1670}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Firestore", "src\Testcontainers.Firestore\Testcontainers.Firestore.csproj", "{B3CC460D-0DFD-48A8-9502-54E9828B7B05}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Firestore", "src\Testcontainers.Firestore\Testcontainers.Firestore.csproj", "{B3CC460D-0DFD-48A8-9502-54E9828B7B05}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.JanusGraph", "src\Testcontainers.JanusGraph\Testcontainers.JanusGraph.csproj", "{C5AF86A8-2F11-41B6-BB01-325AD9016B94}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.JanusGraph", "src\Testcontainers.JanusGraph\Testcontainers.JanusGraph.csproj", "{C5AF86A8-2F11-41B6-BB01-325AD9016B94}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.K3s", "src\Testcontainers.K3s\Testcontainers.K3s.csproj", "{111B840F-9DB0-4166-83E6-0580FD418F07}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.K3s", "src\Testcontainers.K3s\Testcontainers.K3s.csproj", "{111B840F-9DB0-4166-83E6-0580FD418F07}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kafka", "src\Testcontainers.Kafka\Testcontainers.Kafka.csproj", "{E93E40CE-59AA-4561-9B4C-E7B0A686326E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kafka", "src\Testcontainers.Kafka\Testcontainers.Kafka.csproj", "{E93E40CE-59AA-4561-9B4C-E7B0A686326E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Keycloak", "src\Testcontainers.Keycloak\Testcontainers.Keycloak.csproj", "{AA8834A3-82A7-4E83-8E4C-88D37F74056A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Keycloak", "src\Testcontainers.Keycloak\Testcontainers.Keycloak.csproj", "{AA8834A3-82A7-4E83-8E4C-88D37F74056A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kusto", "src\Testcontainers.Kusto\Testcontainers.Kusto.csproj", "{FCF59758-2403-4EC9-9EAE-4EC69A3F27AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kusto", "src\Testcontainers.Kusto\Testcontainers.Kusto.csproj", "{FCF59758-2403-4EC9-9EAE-4EC69A3F27AF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.LocalStack", "src\Testcontainers.LocalStack\Testcontainers.LocalStack.csproj", "{3792268A-EF08-4569-8118-991E08FD61C4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.LocalStack", "src\Testcontainers.LocalStack\Testcontainers.LocalStack.csproj", "{3792268A-EF08-4569-8118-991E08FD61C4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MariaDb", "src\Testcontainers.MariaDb\Testcontainers.MariaDb.csproj", "{4B204EB3-C478-422E-9B6F-62DF3871291A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MariaDb", "src\Testcontainers.MariaDb\Testcontainers.MariaDb.csproj", "{4B204EB3-C478-422E-9B6F-62DF3871291A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Milvus", "src\Testcontainers.Milvus\Testcontainers.Milvus.csproj", "{B024E315-831F-429D-92AA-44B839AC10F4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Milvus", "src\Testcontainers.Milvus\Testcontainers.Milvus.csproj", "{B024E315-831F-429D-92AA-44B839AC10F4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Minio", "src\Testcontainers.Minio\Testcontainers.Minio.csproj", "{1266E1E6-5CEF-4161-8B45-83282455746E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Minio", "src\Testcontainers.Minio\Testcontainers.Minio.csproj", "{1266E1E6-5CEF-4161-8B45-83282455746E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MongoDb", "src\Testcontainers.MongoDb\Testcontainers.MongoDb.csproj", "{2613F146-6C66-4059-9D37-D48BA6B61515}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MongoDb", "src\Testcontainers.MongoDb\Testcontainers.MongoDb.csproj", "{2613F146-6C66-4059-9D37-D48BA6B61515}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MsSql", "src\Testcontainers.MsSql\Testcontainers.MsSql.csproj", "{121FB123-40D9-44D4-9AB7-AD57ED34F466}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MsSql", "src\Testcontainers.MsSql\Testcontainers.MsSql.csproj", "{121FB123-40D9-44D4-9AB7-AD57ED34F466}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MySql", "src\Testcontainers.MySql\Testcontainers.MySql.csproj", "{9FDCFAEA-AE42-4C69-89EF-F1FF75E88CCC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MySql", "src\Testcontainers.MySql\Testcontainers.MySql.csproj", "{9FDCFAEA-AE42-4C69-89EF-F1FF75E88CCC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Nats", "src\Testcontainers.Nats\Testcontainers.Nats.csproj", "{BF37BEA1-0816-4326-B1E0-E82290F8FCE0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Nats", "src\Testcontainers.Nats\Testcontainers.Nats.csproj", "{BF37BEA1-0816-4326-B1E0-E82290F8FCE0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Neo4j", "src\Testcontainers.Neo4j\Testcontainers.Neo4j.csproj", "{ADC2372B-6FE0-421D-8277-BB628E8EFC22}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j", "src\Testcontainers.Neo4j\Testcontainers.Neo4j.csproj", "{ADC2372B-6FE0-421D-8277-BB628E8EFC22}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Oracle", "src\Testcontainers.Oracle\Testcontainers.Oracle.csproj", "{596EAFC1-0496-495C-B382-D57415FA456A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle", "src\Testcontainers.Oracle\Testcontainers.Oracle.csproj", "{596EAFC1-0496-495C-B382-D57415FA456A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{464F1120-A0DA-462B-B9E8-45176D883625}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{464F1120-A0DA-462B-B9E8-45176D883625}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PubSub", "src\Testcontainers.PubSub\Testcontainers.PubSub.csproj", "{E6642255-667D-476B-B584-089AA5E6C0B1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PubSub", "src\Testcontainers.PubSub\Testcontainers.PubSub.csproj", "{E6642255-667D-476B-B584-089AA5E6C0B1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Pulsar", "src\Testcontainers.Pulsar\Testcontainers.Pulsar.csproj", "{27D46863-65B9-4934-B3C8-2383B217A477}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Pulsar", "src\Testcontainers.Pulsar\Testcontainers.Pulsar.csproj", "{27D46863-65B9-4934-B3C8-2383B217A477}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RabbitMq", "src\Testcontainers.RabbitMq\Testcontainers.RabbitMq.csproj", "{A6D480BC-FDE8-4B92-A2A6-FF16BEE486AE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RabbitMq", "src\Testcontainers.RabbitMq\Testcontainers.RabbitMq.csproj", "{A6D480BC-FDE8-4B92-A2A6-FF16BEE486AE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RavenDb", "src\Testcontainers.RavenDb\Testcontainers.RavenDb.csproj", "{F6394475-D6F1-46E2-81BF-4BA78A40B878}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RavenDb", "src\Testcontainers.RavenDb\Testcontainers.RavenDb.csproj", "{F6394475-D6F1-46E2-81BF-4BA78A40B878}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redis", "src\Testcontainers.Redis\Testcontainers.Redis.csproj", "{BFDA179A-40EB-4CEB-B8E9-0DF32C65E2C5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redis", "src\Testcontainers.Redis\Testcontainers.Redis.csproj", "{BFDA179A-40EB-4CEB-B8E9-0DF32C65E2C5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redpanda", "src\Testcontainers.Redpanda\Testcontainers.Redpanda.csproj", "{45D6F69C-4D87-4130-AA90-0DB2F7460DAE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda", "src\Testcontainers.Redpanda\Testcontainers.Redpanda.csproj", "{45D6F69C-4D87-4130-AA90-0DB2F7460DAE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.SqlEdge", "src\Testcontainers.SqlEdge\Testcontainers.SqlEdge.csproj", "{C95A3B2F-2B28-49A7-8806-731C158BBC21}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.SqlEdge", "src\Testcontainers.SqlEdge\Testcontainers.SqlEdge.csproj", "{C95A3B2F-2B28-49A7-8806-731C158BBC21}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ActiveMq.Tests", "tests\Testcontainers.ActiveMq.Tests\Testcontainers.ActiveMq.Tests.csproj", "{AB93C67F-0A53-4525-AE6C-29B065820ABE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ActiveMq.Tests", "tests\Testcontainers.ActiveMq.Tests\Testcontainers.ActiveMq.Tests.csproj", "{AB93C67F-0A53-4525-AE6C-29B065820ABE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ArangoDb.Tests", "tests\Testcontainers.ArangoDb.Tests\Testcontainers.ArangoDb.Tests.csproj", "{8E1E0A6D-EEBB-4455-B8E8-A55AF9B2062C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ArangoDb.Tests", "tests\Testcontainers.ArangoDb.Tests\Testcontainers.ArangoDb.Tests.csproj", "{8E1E0A6D-EEBB-4455-B8E8-A55AF9B2062C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Azurite.Tests", "tests\Testcontainers.Azurite.Tests\Testcontainers.Azurite.Tests.csproj", "{B272FDDE-5E01-425D-B9E1-10FF883DDAAA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Azurite.Tests", "tests\Testcontainers.Azurite.Tests\Testcontainers.Azurite.Tests.csproj", "{B272FDDE-5E01-425D-B9E1-10FF883DDAAA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.BigQuery.Tests", "tests\Testcontainers.BigQuery.Tests\Testcontainers.BigQuery.Tests.csproj", "{03E60673-078A-4508-99AD-8537CE6F78F1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.BigQuery.Tests", "tests\Testcontainers.BigQuery.Tests\Testcontainers.BigQuery.Tests.csproj", "{03E60673-078A-4508-99AD-8537CE6F78F1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Bigtable.Tests", "tests\Testcontainers.Bigtable.Tests\Testcontainers.Bigtable.Tests.csproj", "{2E7B92E3-8526-4706-90F3-00F0F5C47C37}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Bigtable.Tests", "tests\Testcontainers.Bigtable.Tests\Testcontainers.Bigtable.Tests.csproj", "{2E7B92E3-8526-4706-90F3-00F0F5C47C37}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ClickHouse.Tests", "tests\Testcontainers.ClickHouse.Tests\Testcontainers.ClickHouse.Tests.csproj", "{9D0A0B32-4921-400C-99CB-8650677E3E44}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ClickHouse.Tests", "tests\Testcontainers.ClickHouse.Tests\Testcontainers.ClickHouse.Tests.csproj", "{9D0A0B32-4921-400C-99CB-8650677E3E44}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CockroachDb.Tests", "tests\Testcontainers.CockroachDb.Tests\Testcontainers.CockroachDb.Tests.csproj", "{685E6D9A-B05E-41D9-A08E-5F3CA7733F7D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CockroachDb.Tests", "tests\Testcontainers.CockroachDb.Tests\Testcontainers.CockroachDb.Tests.csproj", "{685E6D9A-B05E-41D9-A08E-5F3CA7733F7D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Commons", "tests\Testcontainers.Commons\Testcontainers.Commons.csproj", "{2478673C-B063-469D-ABD1-0C3E0A25541B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Commons", "tests\Testcontainers.Commons\Testcontainers.Commons.csproj", "{2478673C-B063-469D-ABD1-0C3E0A25541B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Consul.Tests", "tests\Testcontainers.Consul.Tests\Testcontainers.Consul.Tests.csproj", "{91B23679-A2A5-4132-8AFA-740CE40A88B6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Consul.Tests", "tests\Testcontainers.Consul.Tests\Testcontainers.Consul.Tests.csproj", "{91B23679-A2A5-4132-8AFA-740CE40A88B6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CosmosDb.Tests", "tests\Testcontainers.CosmosDb.Tests\Testcontainers.CosmosDb.Tests.csproj", "{BD445A54-F411-4758-955E-397A1E98680C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CosmosDb.Tests", "tests\Testcontainers.CosmosDb.Tests\Testcontainers.CosmosDb.Tests.csproj", "{BD445A54-F411-4758-955E-397A1E98680C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Couchbase.Tests", "tests\Testcontainers.Couchbase.Tests\Testcontainers.Couchbase.Tests.csproj", "{809322BA-D690-4F2B-B884-23F895663963}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Couchbase.Tests", "tests\Testcontainers.Couchbase.Tests\Testcontainers.Couchbase.Tests.csproj", "{809322BA-D690-4F2B-B884-23F895663963}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CouchDb.Tests", "tests\Testcontainers.CouchDb.Tests\Testcontainers.CouchDb.Tests.csproj", "{E4520FB1-4466-4DCA-AD08-4075102C68D3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CouchDb.Tests", "tests\Testcontainers.CouchDb.Tests\Testcontainers.CouchDb.Tests.csproj", "{E4520FB1-4466-4DCA-AD08-4075102C68D3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Databases.Tests", "tests\Testcontainers.Databases.Tests\Testcontainers.Databases.Tests.csproj", "{DA54916E-1128-4200-B6AE-9F5BF02D832D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Databases.Tests", "tests\Testcontainers.Databases.Tests\Testcontainers.Databases.Tests.csproj", "{DA54916E-1128-4200-B6AE-9F5BF02D832D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb.Tests", "tests\Testcontainers.DynamoDb.Tests\Testcontainers.DynamoDb.Tests.csproj", "{101515E6-74C1-40F9-85C8-871F742A378D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.DynamoDb.Tests", "tests\Testcontainers.DynamoDb.Tests\Testcontainers.DynamoDb.Tests.csproj", "{101515E6-74C1-40F9-85C8-871F742A378D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb.Tests", "tests\Testcontainers.EventStoreDb.Tests\Testcontainers.EventStoreDb.Tests.csproj", "{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.EventStoreDb.Tests", "tests\Testcontainers.EventStoreDb.Tests\Testcontainers.EventStoreDb.Tests.csproj", "{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FakeGcsServer.Tests", "tests\Testcontainers.FakeGcsServer.Tests\Testcontainers.FakeGcsServer.Tests.csproj", "{9F27AA1B-C25D-400C-BCB0-6B0BF1A1DCEA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FakeGcsServer.Tests", "tests\Testcontainers.FakeGcsServer.Tests\Testcontainers.FakeGcsServer.Tests.csproj", "{9F27AA1B-C25D-400C-BCB0-6B0BF1A1DCEA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FirebirdSql.Tests", "tests\Testcontainers.FirebirdSql.Tests\Testcontainers.FirebirdSql.Tests.csproj", "{E39095AC-9B34-4178-A486-04C902B6FD33}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FirebirdSql.Tests", "tests\Testcontainers.FirebirdSql.Tests\Testcontainers.FirebirdSql.Tests.csproj", "{E39095AC-9B34-4178-A486-04C902B6FD33}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Firestore.Tests", "tests\Testcontainers.Firestore.Tests\Testcontainers.Firestore.Tests.csproj", "{2F0D7CD6-7EA9-46FC-B8F2-25D55699525F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Firestore.Tests", "tests\Testcontainers.Firestore.Tests\Testcontainers.Firestore.Tests.csproj", "{2F0D7CD6-7EA9-46FC-B8F2-25D55699525F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb.Tests", "tests\Testcontainers.InfluxDb.Tests\Testcontainers.InfluxDb.Tests.csproj", "{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.InfluxDb.Tests", "tests\Testcontainers.InfluxDb.Tests\Testcontainers.InfluxDb.Tests.csproj", "{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.JanusGraph.Tests", "tests\Testcontainers.JanusGraph.Tests\Testcontainers.JanusGraph.Tests.csproj", "{BEFC4109-4511-4FBD-AC4F-3D3B388B8CAD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.JanusGraph.Tests", "tests\Testcontainers.JanusGraph.Tests\Testcontainers.JanusGraph.Tests.csproj", "{BEFC4109-4511-4FBD-AC4F-3D3B388B8CAD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.K3s.Tests", "tests\Testcontainers.K3s.Tests\Testcontainers.K3s.Tests.csproj", "{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.K3s.Tests", "tests\Testcontainers.K3s.Tests\Testcontainers.K3s.Tests.csproj", "{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kafka.Tests", "tests\Testcontainers.Kafka.Tests\Testcontainers.Kafka.Tests.csproj", "{6F2AEE03-629A-4B49-BD5B-25CA3C61FFB7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kafka.Tests", "tests\Testcontainers.Kafka.Tests\Testcontainers.Kafka.Tests.csproj", "{6F2AEE03-629A-4B49-BD5B-25CA3C61FFB7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Keycloak.Tests", "tests\Testcontainers.Keycloak.Tests\Testcontainers.Keycloak.Tests.csproj", "{4827D606-89D5-4E00-8341-47A6E95817BA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Keycloak.Tests", "tests\Testcontainers.Keycloak.Tests\Testcontainers.Keycloak.Tests.csproj", "{4827D606-89D5-4E00-8341-47A6E95817BA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kusto.Tests", "tests\Testcontainers.Kusto.Tests\Testcontainers.Kusto.Tests.csproj", "{FA59D75A-8D3A-412C-92E6-4A56033162DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kusto.Tests", "tests\Testcontainers.Kusto.Tests\Testcontainers.Kusto.Tests.csproj", "{FA59D75A-8D3A-412C-92E6-4A56033162DD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.LocalStack.Tests", "tests\Testcontainers.LocalStack.Tests\Testcontainers.LocalStack.Tests.csproj", "{728CBE16-1D52-4F84-AF01-7229E6013512}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.LocalStack.Tests", "tests\Testcontainers.LocalStack.Tests\Testcontainers.LocalStack.Tests.csproj", "{728CBE16-1D52-4F84-AF01-7229E6013512}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MariaDb.Tests", "tests\Testcontainers.MariaDb.Tests\Testcontainers.MariaDb.Tests.csproj", "{7F0AE083-9DB8-4BD4-91F7-C199DCC7301D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MariaDb.Tests", "tests\Testcontainers.MariaDb.Tests\Testcontainers.MariaDb.Tests.csproj", "{7F0AE083-9DB8-4BD4-91F7-C199DCC7301D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Milvus.Tests", "tests\Testcontainers.Milvus.Tests\Testcontainers.Milvus.Tests.csproj", "{5247DF94-32F3-4ED6-AE71-6AB4F4078E6D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Milvus.Tests", "tests\Testcontainers.Milvus.Tests\Testcontainers.Milvus.Tests.csproj", "{5247DF94-32F3-4ED6-AE71-6AB4F4078E6D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Minio.Tests", "tests\Testcontainers.Minio.Tests\Testcontainers.Minio.Tests.csproj", "{5DB1F35F-B714-4B62-84BE-16A33084D3E1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Minio.Tests", "tests\Testcontainers.Minio.Tests\Testcontainers.Minio.Tests.csproj", "{5DB1F35F-B714-4B62-84BE-16A33084D3E1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MongoDb.Tests", "tests\Testcontainers.MongoDb.Tests\Testcontainers.MongoDb.Tests.csproj", "{82A7E7B8-3187-4CAE-845B-0BF43409B38A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MongoDb.Tests", "tests\Testcontainers.MongoDb.Tests\Testcontainers.MongoDb.Tests.csproj", "{82A7E7B8-3187-4CAE-845B-0BF43409B38A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MsSql.Tests", "tests\Testcontainers.MsSql.Tests\Testcontainers.MsSql.Tests.csproj", "{25DBED78-99F4-433F-BBF5-1B4E9DEAE437}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MsSql.Tests", "tests\Testcontainers.MsSql.Tests\Testcontainers.MsSql.Tests.csproj", "{25DBED78-99F4-433F-BBF5-1B4E9DEAE437}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MySql.Tests", "tests\Testcontainers.MySql.Tests\Testcontainers.MySql.Tests.csproj", "{E42DA1CE-698F-4E45-8D1F-5D5895893840}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MySql.Tests", "tests\Testcontainers.MySql.Tests\Testcontainers.MySql.Tests.csproj", "{E42DA1CE-698F-4E45-8D1F-5D5895893840}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Nats.Tests", "tests\Testcontainers.Nats.Tests\Testcontainers.Nats.Tests.csproj", "{87A3F137-6DC3-4CE5-91E6-01797D076086}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Nats.Tests", "tests\Testcontainers.Nats.Tests\Testcontainers.Nats.Tests.csproj", "{87A3F137-6DC3-4CE5-91E6-01797D076086}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Neo4j.Tests", "tests\Testcontainers.Neo4j.Tests\Testcontainers.Neo4j.Tests.csproj", "{D3F63405-C0FA-4F83-8B79-E30BFF5FF5BF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j.Tests", "tests\Testcontainers.Neo4j.Tests\Testcontainers.Neo4j.Tests.csproj", "{D3F63405-C0FA-4F83-8B79-E30BFF5FF5BF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Oracle.Tests", "tests\Testcontainers.Oracle.Tests\Testcontainers.Oracle.Tests.csproj", "{4AC1088B-9965-4497-AC8E-570F1AD5631F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle.Tests", "tests\Testcontainers.Oracle.Tests\Testcontainers.Oracle.Tests.csproj", "{4AC1088B-9965-4497-AC8E-570F1AD5631F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{904C8476-FCEF-41F0-8948-9EFA7C08712E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{904C8476-FCEF-41F0-8948-9EFA7C08712E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Platform.Windows.Tests", "tests\Testcontainers.Platform.Windows.Tests\Testcontainers.Platform.Windows.Tests.csproj", "{3E55CBE8-AFE8-426D-9470-49D63CD1051C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Windows.Tests", "tests\Testcontainers.Platform.Windows.Tests\Testcontainers.Platform.Windows.Tests.csproj", "{3E55CBE8-AFE8-426D-9470-49D63CD1051C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PostgreSql.Tests", "tests\Testcontainers.PostgreSql.Tests\Testcontainers.PostgreSql.Tests.csproj", "{56D0DCA5-567F-4B3B-8B79-CB108F8EB8A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PostgreSql.Tests", "tests\Testcontainers.PostgreSql.Tests\Testcontainers.PostgreSql.Tests.csproj", "{56D0DCA5-567F-4B3B-8B79-CB108F8EB8A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PubSub.Tests", "tests\Testcontainers.PubSub.Tests\Testcontainers.PubSub.Tests.csproj", "{0F86BCE8-62E1-4BFC-AA84-63C7514C90AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PubSub.Tests", "tests\Testcontainers.PubSub.Tests\Testcontainers.PubSub.Tests.csproj", "{0F86BCE8-62E1-4BFC-AA84-63C7514C90AC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Pulsar.Tests", "tests\Testcontainers.Pulsar.Tests\Testcontainers.Pulsar.Tests.csproj", "{D05FCB31-793E-43E0-BD6C-077013AE9113}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Pulsar.Tests", "tests\Testcontainers.Pulsar.Tests\Testcontainers.Pulsar.Tests.csproj", "{D05FCB31-793E-43E0-BD6C-077013AE9113}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RabbitMq.Tests", "tests\Testcontainers.RabbitMq.Tests\Testcontainers.RabbitMq.Tests.csproj", "{19564567-1736-4626-B406-17E4E02F18B2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RabbitMq.Tests", "tests\Testcontainers.RabbitMq.Tests\Testcontainers.RabbitMq.Tests.csproj", "{19564567-1736-4626-B406-17E4E02F18B2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RavenDb.Tests", "tests\Testcontainers.RavenDb.Tests\Testcontainers.RavenDb.Tests.csproj", "{D53726B6-5447-47E6-B881-A44EFF6E5534}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RavenDb.Tests", "tests\Testcontainers.RavenDb.Tests\Testcontainers.RavenDb.Tests.csproj", "{D53726B6-5447-47E6-B881-A44EFF6E5534}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redis.Tests", "tests\Testcontainers.Redis.Tests\Testcontainers.Redis.Tests.csproj", "{31EE94A0-E721-4073-B6F1-DD912D004DEF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redis.Tests", "tests\Testcontainers.Redis.Tests\Testcontainers.Redis.Tests.csproj", "{31EE94A0-E721-4073-B6F1-DD912D004DEF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redpanda.Tests", "tests\Testcontainers.Redpanda.Tests\Testcontainers.Redpanda.Tests.csproj", "{867BD04E-4670-4FBA-98D5-9F83220E6DFB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda.Tests", "tests\Testcontainers.Redpanda.Tests\Testcontainers.Redpanda.Tests.csproj", "{867BD04E-4670-4FBA-98D5-9F83220E6DFB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ResourceReaper.Tests", "tests\Testcontainers.ResourceReaper.Tests\Testcontainers.ResourceReaper.Tests.csproj", "{9E8E6AA5-65D1-498F-BEAB-BA34723A0050}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ResourceReaper.Tests", "tests\Testcontainers.ResourceReaper.Tests\Testcontainers.ResourceReaper.Tests.csproj", "{9E8E6AA5-65D1-498F-BEAB-BA34723A0050}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.SqlEdge.Tests", "tests\Testcontainers.SqlEdge.Tests\Testcontainers.SqlEdge.Tests.csproj", "{1A1983E6-5297-435F-B467-E8E1F11277D6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.SqlEdge.Tests", "tests\Testcontainers.SqlEdge.Tests\Testcontainers.SqlEdge.Tests.csproj", "{1A1983E6-5297-435F-B467-E8E1F11277D6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Db2", "src\Testcontainers.Db2\Testcontainers.Db2.csproj", "{1539EE72-8D60-4CFD-A665-4E74DF9A0383}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Db2.Tests", "tests\Testcontainers.Db2.Tests\Testcontainers.Db2.Tests.csproj", "{3C75CDA1-DE02-4611-864F-63B1282CAC51}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -580,6 +581,17 @@ Global {EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}.Debug|Any CPU.Build.0 = Debug|Any CPU {EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}.Release|Any CPU.ActiveCfg = Release|Any CPU {EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}.Release|Any CPU.Build.0 = Release|Any CPU + {1539EE72-8D60-4CFD-A665-4E74DF9A0383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1539EE72-8D60-4CFD-A665-4E74DF9A0383}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1539EE72-8D60-4CFD-A665-4E74DF9A0383}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1539EE72-8D60-4CFD-A665-4E74DF9A0383}.Release|Any CPU.Build.0 = Release|Any CPU + {3C75CDA1-DE02-4611-864F-63B1282CAC51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C75CDA1-DE02-4611-864F-63B1282CAC51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C75CDA1-DE02-4611-864F-63B1282CAC51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C75CDA1-DE02-4611-864F-63B1282CAC51}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {5365F780-0E6C-41F0-B1B9-7DC34368F80C} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} @@ -675,5 +687,10 @@ Global {1A1983E6-5297-435F-B467-E8E1F11277D6} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {27CDB869-A150-4593-958F-6F26E5391E7C} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} + {1539EE72-8D60-4CFD-A665-4E74DF9A0383} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} + {3C75CDA1-DE02-4611-864F-63B1282CAC51} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E14E3882-9BA0-4849-9DB5-C72F31F6F68A} EndGlobalSection EndGlobal diff --git a/src/Testcontainers.Db2/.editorconfig b/src/Testcontainers.Db2/.editorconfig new file mode 100644 index 000000000..6f066619d --- /dev/null +++ b/src/Testcontainers.Db2/.editorconfig @@ -0,0 +1 @@ +root = true \ No newline at end of file diff --git a/src/Testcontainers.Db2/Db2Builder.cs b/src/Testcontainers.Db2/Db2Builder.cs new file mode 100644 index 000000000..6ccc61fa4 --- /dev/null +++ b/src/Testcontainers.Db2/Db2Builder.cs @@ -0,0 +1,191 @@ +using System.Linq; +using System.Threading.Tasks; + +namespace Testcontainers.Db2; + +/// +[PublicAPI] +public sealed class Db2Builder : ContainerBuilder +{ + public const string Db2Image = "icr.io/db2_community/db2:latest"; + + public const ushort Db2Port = 50000; + + public const string DefaultDatabase = "test"; + + public const string DefaultUsername = "db2inst1"; + + public const string DefaultPassword = "test123"; + + public const string DefaultLicenseAgreement = "accept"; + + /// + /// Initializes a new instance of the class. + /// + public Db2Builder() + : this(new Db2Configuration()) + { + DockerResourceConfiguration = Init().DockerResourceConfiguration; + } + + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + private Db2Builder(Db2Configuration resourceConfiguration) + : base(resourceConfiguration) + { + DockerResourceConfiguration = resourceConfiguration; + } + + /// + protected override Db2Configuration DockerResourceConfiguration { get; } + + /// + /// Sets the Db2 database name. + /// + /// The Db2 database. + /// A configured instance of . + public Db2Builder WithDatabase(string database) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(database: database)) + .WithEnvironment("DBNAME", database); + } + + /// + /// Sets the Db2 username. + /// + /// The Db2 username. + /// A configured instance of . + public Db2Builder WithUsername(string username) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(username: username)) + .WithEnvironment("DB2INSTANCE", username); + } + + /// + /// Sets the Db2 password. + /// + /// The Db2 password. + /// A configured instance of . + public Db2Builder WithPassword(string password) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(password: password)) + .WithEnvironment("DB2INST1_PASSWORD", password); + } + + /// + /// Sets the Db2 archive logs. + /// + /// The Db2 archive logs setting. + /// A configured instance of . + public Db2Builder WithArchiveLogs(bool archiveLogs) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(archiveLogs: archiveLogs)) + .WithEnvironment("ARCHIVE_LOGS", archiveLogs.ToString()); + } + + /// + /// Sets the Db2 autoconfig setting. + /// + /// The Db2 autoconfig setting. + /// A configured instance of . + public Db2Builder WithAutoconfig(bool autoConfig) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(autoConfig: autoConfig)) + .WithEnvironment("AUTOCONFIG", autoConfig.ToString()); + } + + /// + /// Accepts the Db2 license agreement. + /// + /// A configured instance of . + public Db2Builder WithLicenseAgreement() + { + return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultLicenseAgreement)) + .WithEnvironment("LICENSE", DefaultLicenseAgreement); + } + + /// + /// + public override Db2Container Build() + { + Validate(); + + // By default, the base builder waits until the container is running. However, for MySql, a more advanced waiting strategy is necessary that requires access to the configured database, username and password. + // If the user does not provide a custom waiting strategy, append the default MySql waiting strategy. + var db2Builder = DockerResourceConfiguration.WaitStrategies.Count() > 1 + ? this + : WithWaitStrategy(Wait.ForUnixContainer() + .UntilMessageIsLogged("All databases are now active") + .UntilMessageIsLogged("Setup has completed.") + .AddCustomWaitStrategy(new WaitUntil(DockerResourceConfiguration)) + ); + + return new Db2Container(db2Builder.DockerResourceConfiguration); + } + + /// + protected override Db2Builder Init() => base.Init() + .WithImage(Db2Image) + .WithPortBinding(Db2Port, true) + .WithDatabase(DefaultDatabase) + .WithUsername(DefaultUsername) + .WithPassword(DefaultPassword) + .WithLicenseAgreement() + .WithPrivileged(true); + + /// + protected override void Validate() + { + base.Validate(); + + _ = Guard.Argument(DockerResourceConfiguration.Username, nameof(DockerResourceConfiguration.Username)) + .NotNull() + .NotEmpty(); + + _ = Guard.Argument(DockerResourceConfiguration.Password, nameof(DockerResourceConfiguration.Password)) + .NotNull() + .NotEmpty(); + } + + /// + protected override Db2Builder Clone(IResourceConfiguration resourceConfiguration) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(resourceConfiguration)); + } + + /// + protected override Db2Builder Clone(IContainerConfiguration resourceConfiguration) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(resourceConfiguration)); + } + + /// + protected override Db2Builder Merge(Db2Configuration oldValue, Db2Configuration newValue) + { + return new Db2Builder(new Db2Configuration(oldValue, newValue)); + } + + /// + private sealed class WaitUntil : IWaitUntil + { + /// + /// Initializes a new instance of the class. + /// + /// The container configuration. + public WaitUntil(Db2Configuration configuration) + { + } + + /// + public async Task UntilAsync(IContainer container) + { + var db2Container = (Db2Container)container; + + var execResult = await db2Container.ExecScriptAsync("SELECT 1 FROM SYSIBM.SYSDUMMY1").ConfigureAwait(false); + + return 0L.Equals(execResult.ExitCode); + } + } +} diff --git a/src/Testcontainers.Db2/Db2Configuration.cs b/src/Testcontainers.Db2/Db2Configuration.cs new file mode 100644 index 000000000..79ba433f4 --- /dev/null +++ b/src/Testcontainers.Db2/Db2Configuration.cs @@ -0,0 +1,96 @@ +namespace Testcontainers.Db2; + +/// +[PublicAPI] +public sealed class Db2Configuration : ContainerConfiguration +{ + + /// + /// Initializes a new instance of the class. + /// + /// The Db2 database. + /// The Db2 username. + /// The Db2 password. + /// The Db2 archive logs setting. + /// The Db2 auto config setting. + /// The Db2 license agreement. + public Db2Configuration( + string database = null, + string username = null, + string password = null, + bool archiveLogs = false, + bool autoConfig = false, + string licenseAgreement = null) + { + Database = database; + Username = username; + Password = password; + ArchiveLogs = archiveLogs; + AutoConfig = autoConfig; + LicenseAgreement = licenseAgreement; + } + + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + public Db2Configuration(IResourceConfiguration resourceConfiguration) + : base(resourceConfiguration) + { + // Passes the configuration upwards to the base implementations to create an updated immutable copy. + } + + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + public Db2Configuration(IContainerConfiguration resourceConfiguration) + : base(resourceConfiguration) + { + // Passes the configuration upwards to the base implementations to create an updated immutable copy. + } + + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + public Db2Configuration(Db2Configuration resourceConfiguration) + : this(new Db2Configuration(), resourceConfiguration) + { + // Passes the configuration upwards to the base implementations to create an updated immutable copy. + } + + /// + /// Initializes a new instance of the class. + /// + /// The old Docker resource configuration. + /// The new Docker resource configuration. + public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) + : base(oldValue, newValue) + { + Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database); + Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username); + Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password); + } + + /// + /// Gets the Db2 database. + /// + public string Database { get; } + + /// + /// Gets the Db2 username. + /// + public string Username { get; } + + /// + /// Gets the Db2 password. + /// + public string Password { get; } + + public bool ArchiveLogs { get; } + + public bool AutoConfig { get; } + + public string LicenseAgreement { get; } +} diff --git a/src/Testcontainers.Db2/Db2Container.cs b/src/Testcontainers.Db2/Db2Container.cs new file mode 100644 index 000000000..3c5d9036c --- /dev/null +++ b/src/Testcontainers.Db2/Db2Container.cs @@ -0,0 +1,42 @@ +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace Testcontainers.Db2 +{ + /// + [PublicAPI] + public sealed class Db2Container : DockerContainer, IDatabaseContainer + { + private static string Db2CommandPath = "/opt/ibm/db2/*/bin/db2"; + + private readonly Db2Configuration _configuration; + + private const char ConnectionStringDelimiter = ';'; + + public Db2Container(Db2Configuration configuration) : base(configuration) + { + _configuration = configuration; + } + + public string GetConnectionString() => new StringBuilder() + .Append("Server=").Append(Hostname).Append(":").Append(GetMappedPublicPort(Db2Builder.Db2Port).ToString()).Append(ConnectionStringDelimiter) + .Append("Database=").Append(_configuration.Database).Append(ConnectionStringDelimiter) + .Append("UID=").Append(_configuration.Username).Append(ConnectionStringDelimiter) + .Append("PWD=").Append(_configuration.Password).Append(ConnectionStringDelimiter) + .ToString(); + + public async Task ExecScriptAsync(string scriptContent, CancellationToken cancellationToken = default) + { + string[] command = ["su", "db2inst1", "-c", new StringBuilder() + .Append(Db2CommandPath).Append(" connect to ").Append(_configuration.Database) + .Append(" user ").Append(_configuration.Username).Append(" using ").Append(_configuration.Password) + .Append("; ") + .Append(Db2CommandPath).Append(" ").Append(scriptContent) + .ToString() + ]; + + return await ExecAsync(command).ConfigureAwait(false); + } + } +} diff --git a/src/Testcontainers.Db2/Testcontainers.Db2.csproj b/src/Testcontainers.Db2/Testcontainers.Db2.csproj new file mode 100644 index 000000000..7a7ebd95d --- /dev/null +++ b/src/Testcontainers.Db2/Testcontainers.Db2.csproj @@ -0,0 +1,12 @@ + + + net6.0;net8.0;netstandard2.0;netstandard2.1 + latest + + + + + + + + diff --git a/src/Testcontainers.Db2/Usings.cs b/src/Testcontainers.Db2/Usings.cs new file mode 100644 index 000000000..6d8716201 --- /dev/null +++ b/src/Testcontainers.Db2/Usings.cs @@ -0,0 +1,7 @@ +global using Docker.DotNet.Models; +global using DotNet.Testcontainers; +global using DotNet.Testcontainers.Builders; +global using DotNet.Testcontainers.Configurations; +global using DotNet.Testcontainers.Containers; +global using JetBrains.Annotations; +global using System; diff --git a/tests/Testcontainers.Db2.Tests/.editorconfig b/tests/Testcontainers.Db2.Tests/.editorconfig new file mode 100644 index 000000000..6f066619d --- /dev/null +++ b/tests/Testcontainers.Db2.Tests/.editorconfig @@ -0,0 +1 @@ +root = true \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs new file mode 100644 index 000000000..dbf661099 --- /dev/null +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -0,0 +1,47 @@ +using IBM.Data.Db2; + +namespace Testcontainers.Db2; + +public sealed class Db2ContainerTest : IAsyncLifetime +{ + private readonly Db2Container _db2Container = new Db2Builder().Build(); + + public Task InitializeAsync() + { + return _db2Container.StartAsync(); + } + + public Task DisposeAsync() + { + return _db2Container.DisposeAsync().AsTask(); + } + + [Fact] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] + public void ConnectionStateReturnsOpen() + { + // Given + using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); + + // When + connection.Open(); + + // Then + Assert.Equal(ConnectionState.Open, connection.State); + } + + [Fact] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] + public async Task ExecScriptReturnsSuccessful() + { + // Given + const string scriptContent = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; + + // When + var execResult = await _db2Container.ExecScriptAsync(scriptContent); + + // Then + Assert.True(0L.Equals(execResult.ExitCode), execResult.Stderr); + Assert.Empty(execResult.Stderr); + } +} \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj new file mode 100644 index 000000000..32693ed96 --- /dev/null +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -0,0 +1,18 @@ + + + net8.0 + false + false + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Usings.cs b/tests/Testcontainers.Db2.Tests/Usings.cs new file mode 100644 index 000000000..7b43902c3 --- /dev/null +++ b/tests/Testcontainers.Db2.Tests/Usings.cs @@ -0,0 +1,5 @@ +global using DotNet.Testcontainers.Commons; +global using System.Data; +global using System.Data.Common; +global using System.Threading.Tasks; +global using Xunit; \ No newline at end of file From 5feb0d0f53d51085d311b91df28bb41e8ae62610 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 20 Aug 2024 12:27:16 +0200 Subject: [PATCH 02/33] Add windows / linux switch for Db2 dependency --- Directory.Packages.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f532da00e..41076b994 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,7 +35,8 @@ - + + From 5558efe5ccd4e58b7649ce4ccd74df84d34650d5 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 20 Aug 2024 13:54:49 +0200 Subject: [PATCH 03/33] Adjust conditional references --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 41076b994..3ae11e052 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,8 +35,8 @@ - - + + From 7444da83737a6fbded1aa7c039bdabb3c74f633c Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 20 Aug 2024 15:19:42 +0200 Subject: [PATCH 04/33] Revert conditional Db2 packages to use OS variable --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3ae11e052..a8048c36c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,8 +35,8 @@ - - + + From 780f617e775f7a639458027501ce257b80bf8009 Mon Sep 17 00:00:00 2001 From: Kevin Schoenfeld Date: Tue, 20 Aug 2024 15:51:10 +0200 Subject: [PATCH 05/33] Remove windows condition for non is specific db2 dependency --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a8048c36c..a41e52653 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,7 +35,7 @@ - + From 2a690e6dc0102e7a2c0cbd38adad1f2e52600a57 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Wed, 21 Aug 2024 09:56:40 +0200 Subject: [PATCH 06/33] Adjust platform specific Db2 package conditions --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a41e52653..7215d133d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,8 +35,8 @@ - - + + From 7d05809a9a86063ed2ee66437f71c80bfe74e326 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Wed, 21 Aug 2024 10:21:37 +0200 Subject: [PATCH 07/33] Add Db2 windows dependency condition --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7215d133d..6a4d05b8b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,7 +35,7 @@ - + From e11fdb28c462a3fbc2caa16b7cdbf332a0a72592 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Wed, 21 Aug 2024 10:32:02 +0200 Subject: [PATCH 08/33] Add Db2 dependency conditionals to test project --- tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index 32693ed96..7570f466f 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -7,7 +7,8 @@ - + + From 128b9968012db40c3007cc70b579b21c3ff244be Mon Sep 17 00:00:00 2001 From: k3v1n Date: Wed, 21 Aug 2024 11:03:20 +0200 Subject: [PATCH 09/33] Run Db2 connection test only on windows due to issues with the ubuntu test runner --- tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index dbf661099..5205b8355 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -17,7 +17,7 @@ public Task DisposeAsync() } [Fact] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Windows))] public void ConnectionStateReturnsOpen() { // Given @@ -31,6 +31,7 @@ public void ConnectionStateReturnsOpen() } [Fact] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Windows))] [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] public async Task ExecScriptReturnsSuccessful() { From 3597532fcc1d48fe81a09a1f209c46399d6a3553 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Wed, 21 Aug 2024 11:21:48 +0200 Subject: [PATCH 10/33] Attempt to exclude Db2 connection test on ubuntu runner --- tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs | 6 +++--- .../Testcontainers.Db2.Tests.csproj | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index 5205b8355..c77bdad40 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -1,4 +1,5 @@ using IBM.Data.Db2; +using Testcontainers.Tests; namespace Testcontainers.Db2; @@ -16,8 +17,8 @@ public Task DisposeAsync() return _db2Container.DisposeAsync().AsTask(); } - [Fact] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Windows))] + [SkipOnLinuxEngine] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] public void ConnectionStateReturnsOpen() { // Given @@ -31,7 +32,6 @@ public void ConnectionStateReturnsOpen() } [Fact] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Windows))] [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] public async Task ExecScriptReturnsSuccessful() { diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index 7570f466f..cb411e4bf 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -15,5 +15,6 @@ + \ No newline at end of file From 398976b8e2d66fc21e1d419c4456e65610a4661c Mon Sep 17 00:00:00 2001 From: Kevin Schoenfeld Date: Wed, 21 Aug 2024 13:58:28 +0200 Subject: [PATCH 11/33] Update docker platform trait for windows only test --- tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index c77bdad40..98c14137b 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -18,7 +18,7 @@ public Task DisposeAsync() } [SkipOnLinuxEngine] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Windows))] public void ConnectionStateReturnsOpen() { // Given @@ -45,4 +45,4 @@ public async Task ExecScriptReturnsSuccessful() Assert.True(0L.Equals(execResult.ExitCode), execResult.Stderr); Assert.Empty(execResult.Stderr); } -} \ No newline at end of file +} From 8f219eb08f7e176f6c0a6f146bd74807724443d4 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Thu, 22 Aug 2024 11:36:09 +0200 Subject: [PATCH 12/33] Set environment variables for Db2 test to run on linux --- .github/workflows/cicd.yml | 7 +++++++ tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs | 4 ++-- .../Testcontainers.Db2.Tests.csproj | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 29deb471b..599281f8a 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -75,6 +75,13 @@ jobs: - name: Run Build run: dotnet cake --target=Build + - name: Prepare Db2 test environment variables + run: | + echo "${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_PATH \ + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_PATH \ + echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_PATH + - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index 98c14137b..2f785db3a 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -17,8 +17,8 @@ public Task DisposeAsync() return _db2Container.DisposeAsync().AsTask(); } - [SkipOnLinuxEngine] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Windows))] + [Fact] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] public void ConnectionStateReturnsOpen() { // Given diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index cb411e4bf..c26035f41 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -3,6 +3,7 @@ net8.0 false false + amd64 From 65c88d9afb9ca16f53dcbc29a93d5ceafa096deb Mon Sep 17 00:00:00 2001 From: k3v1n Date: Thu, 22 Aug 2024 11:51:48 +0200 Subject: [PATCH 13/33] Add condition to only set db2 env variables for linux, fix variable syntax --- .github/workflows/cicd.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 599281f8a..0c112fbd2 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -76,11 +76,12 @@ jobs: run: dotnet cake --target=Build - name: Prepare Db2 test environment variables + if: runner.os == 'Linux' run: | - echo "${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_PATH \ - echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_PATH + echo "${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_PATH \ + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_PATH \ + echo "DB2_CLI_DRIVER_INSTALL_PATH=${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_PATH - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} From fd98e1783ed1feec7938b3b805906cb95b5d25fd Mon Sep 17 00:00:00 2001 From: Kevin Schoenfeld Date: Thu, 22 Aug 2024 22:54:06 +0200 Subject: [PATCH 14/33] Update cicd.yml --- .github/workflows/cicd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 0c112fbd2..46abd917f 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -79,9 +79,9 @@ jobs: if: runner.os == 'Linux' run: | echo "${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_PATH \ - echo "DB2_CLI_DRIVER_INSTALL_PATH=${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV \ + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ + echo "DB2_CLI_DRIVER_INSTALL_PATH=${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} From 827b5cf55cade66b53f98577e961d9ee11d2aed9 Mon Sep 17 00:00:00 2001 From: Kevin Schoenfeld Date: Thu, 22 Aug 2024 23:44:35 +0200 Subject: [PATCH 15/33] Update cicd.yml --- .github/workflows/cicd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 46abd917f..1a839ec40 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -78,10 +78,10 @@ jobs: - name: Prepare Db2 test environment variables if: runner.os == 'Linux' run: | - echo "${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV \ - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ - echo "DB2_CLI_DRIVER_INSTALL_PATH=${GITHUB_WORKSPACE}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV + echo "${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV \ + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ + echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} From 0872bf9c8e25a3ba28636490def9d637d7acf26a Mon Sep 17 00:00:00 2001 From: Kevin Schoenfeld Date: Thu, 22 Aug 2024 23:56:08 +0200 Subject: [PATCH 16/33] Update cicd.yml --- .github/workflows/cicd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 1a839ec40..1f5c08733 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -78,10 +78,10 @@ jobs: - name: Prepare Db2 test environment variables if: runner.os == 'Linux' run: | - echo "${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV \ - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ - echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ env.GITHUB_WORKSPACE }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV + echo "${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV \ + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ + echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} From 974b86949a5c14c588f80bd164834890c4614d9e Mon Sep 17 00:00:00 2001 From: k3v1n Date: Fri, 23 Aug 2024 08:30:28 +0200 Subject: [PATCH 17/33] Add Db2 environment variables debug --- .github/workflows/cicd.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 1f5c08733..bbdde2d94 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -83,6 +83,13 @@ jobs: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV + - name: Debug Db2 environment variables + if: runner.os == 'Linux' + run: | + echo "$PATH" \ + echo "$LD_LIBRARY_PATH" \ + echo "$DB2_CLI_DRIVER_INSTALL_PATH" + - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} From 2aee543c3018d76140e47d54c4eb8fb7db4271a6 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Fri, 23 Aug 2024 08:40:16 +0200 Subject: [PATCH 18/33] Remove command continuation for Db2 variables --- .github/workflows/cicd.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index bbdde2d94..ad9728379 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -78,16 +78,16 @@ jobs: - name: Prepare Db2 test environment variables if: runner.os == 'Linux' run: | - echo "${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH \ - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV \ - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV \ + echo "${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV - name: Debug Db2 environment variables if: runner.os == 'Linux' run: | - echo "$PATH" \ - echo "$LD_LIBRARY_PATH" \ + echo "$PATH" + echo "$LD_LIBRARY_PATH" echo "$DB2_CLI_DRIVER_INSTALL_PATH" - name: Run Tests From 45694abf7dccbf949a50a267217edab3190485d0 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Fri, 23 Aug 2024 09:15:36 +0200 Subject: [PATCH 19/33] Adjust Db2 env variables --- .github/workflows/cicd.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index ad9728379..0d2557656 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -79,8 +79,7 @@ jobs: if: runner.os == 'Linux' run: | echo "${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV - name: Debug Db2 environment variables From 9f3ab655c8033b10203baa3d22abe32d17a6c13e Mon Sep 17 00:00:00 2001 From: k3v1n Date: Fri, 23 Aug 2024 13:54:44 +0200 Subject: [PATCH 20/33] Generate runsettings file to prepare environment variables required for Db2 on linux --- .github/workflows/cicd.yml | 14 ------------- .../Testcontainers.Db2.Tests.csproj | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 0d2557656..29deb471b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -75,20 +75,6 @@ jobs: - name: Run Build run: dotnet cake --target=Build - - name: Prepare Db2 test environment variables - if: runner.os == 'Linux' - run: | - echo "${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/bin" >> $GITHUB_PATH - echo "LD_LIBRARY_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib:${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver/lib/icc" >> $GITHUB_ENV - echo "DB2_CLI_DRIVER_INSTALL_PATH=${{ github.workspace }}/tests/TestContainers.Db2.Tests/bin/Debug/net8.0/clidriver" >> $GITHUB_ENV - - - name: Debug Db2 environment variables - if: runner.os == 'Linux' - run: | - echo "$PATH" - echo "$LD_LIBRARY_PATH" - echo "$DB2_CLI_DRIVER_INSTALL_PATH" - - name: Run Tests run: dotnet cake --target=Tests --test-filter=${{ startsWith(matrix.os, 'ubuntu') && 'FullyQualifiedName~Testcontainers' || 'DockerPlatform=Windows' }} diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index c26035f41..be26331e2 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -1,9 +1,29 @@ + + + + + + + + + + + + + + + net8.0 false false amd64 + $(MSBuildProjectDirectory)/linux.runsettings From d7be1e7553c653a36804e7905aa80586cefe8e99 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Sat, 24 Aug 2024 22:28:59 +0200 Subject: [PATCH 21/33] Adjust Db2 linux runsetting generation to fill a template file instead of generating the whole file --- .../Testcontainers.Db2.Tests.csproj | 30 +++++++++---------- .../linux.runsettings | 10 +++++++ 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 tests/Testcontainers.Db2.Tests/linux.runsettings diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index be26331e2..fcd7029eb 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -1,21 +1,19 @@ - - - - - - - - - - - - - + + diff --git a/tests/Testcontainers.Db2.Tests/linux.runsettings b/tests/Testcontainers.Db2.Tests/linux.runsettings new file mode 100644 index 000000000..451ec8843 --- /dev/null +++ b/tests/Testcontainers.Db2.Tests/linux.runsettings @@ -0,0 +1,10 @@ + + + + + Filled by msbuild + Filled by msbuild + Filled by msbuild + + + \ No newline at end of file From 8682b88dd7a944c4cf361c927c86e6f961ecfd78 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Sat, 31 Aug 2024 21:55:36 +0200 Subject: [PATCH 22/33] Add documentation and adjust test case for connectionstring --- docs/modules/db2.md | 113 ++++++++++++++++++ .../Db2ContainerTest.cs | 9 +- 2 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 docs/modules/db2.md diff --git a/docs/modules/db2.md b/docs/modules/db2.md new file mode 100644 index 000000000..214c50ed1 --- /dev/null +++ b/docs/modules/db2.md @@ -0,0 +1,113 @@ +# IBM DB2 + +[IBM DB2](https://www.ibm.com/db2), is a relational database engine developed by IBM. The following example provides .NET developers with a starting point to use a IBM DB2 instance in the [xUnit][xunit] tests. + +The following example (for windows) uses the following NuGet packages: + +```console title="Install the NuGet dependencies" +dotnet add package Testcontainers.Db2 +dotnet add package Net.IBM.Data.Db2 +dotnet add package xunit +``` + +Please note: For linux there are currently some hurdles and the package Net.IBM.Data.Db2-lnx has to be used with the following environment variables being set: + + - LD_LIBRARY_PATH + - PATH + - DB2_CLI_DRIVER_INSTALL_PATH + +One way to achieve this within a test project is to extend the .csproj with a task that writes a .runsettings file. An example is given below: + +```xml + + + + + + + + net8.0 + false + false + amd64 + $(MSBuildProjectDirectory)/linux.runsettings + + + + + + + + + + + + + + + +``` + +IDEs and editors may also require the following packages to run tests: `xunit.runner.visualstudio` and `Microsoft.NET.Test.Sdk`. + +Copy and paste the following code into a new `.cs` test file within an existing test project. + +```csharp +using IBM.Data.Db2; + +namespace Testcontainers.Db2; + +public sealed class Db2ContainerTest : IAsyncLifetime +{ + private readonly Db2Container _db2Container = new Db2Builder().Build(); + + public Task InitializeAsync() + { + return _db2Container.StartAsync(); + } + + public Task DisposeAsync() + { + return _db2Container.DisposeAsync().AsTask(); + } + + [Fact] + public async Task ReadFromDb2Database() + { + // Given + using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); + + // When + connection.Open(); + + using DbCommand command = connection.CreateCommand(); + command.CommandText = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; + + var actual = await command.ExecuteScalarAsync() as int?; + Assert.Equal(1, actual.GetValueOrDefault()); + + // Then + Assert.Equal(ConnectionState.Open, connection.State); + } +} +``` + +To execute the tests, use the command `dotnet test` from a terminal. + +## A Note To Developers + +Once Testcontainers creates a server instance, developers may use the connection string with any of the popular data-access technologies found in the .NET Ecosystem. Some of these libraries include [Entity Framework Core](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore), [Dapper](https://www.nuget.org/packages/Dapper), and [NHibernate](https://www.nuget.org/packages/NHibernate). At which point, developers can execute database migrations and SQL scripts. + +[xunit]: https://xunit.net/ diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index 2f785db3a..ef9b0606d 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -1,5 +1,4 @@ using IBM.Data.Db2; -using Testcontainers.Tests; namespace Testcontainers.Db2; @@ -19,7 +18,7 @@ public Task DisposeAsync() [Fact] [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] - public void ConnectionStateReturnsOpen() + public async Task ReadFromDb2Database() { // Given using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); @@ -27,6 +26,12 @@ public void ConnectionStateReturnsOpen() // When connection.Open(); + using DbCommand command = connection.CreateCommand(); + command.CommandText = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; + + var actual = await command.ExecuteScalarAsync() as int?; + Assert.Equal(1, actual.GetValueOrDefault()); + // Then Assert.Equal(ConnectionState.Open, connection.State); } From 0f81656d5200b3a7401e0b056094c5b0f81755bf Mon Sep 17 00:00:00 2001 From: Kevin Schoenfeld Date: Sun, 1 Sep 2024 13:22:57 +0200 Subject: [PATCH 23/33] Add Db2 module documentation to navigation --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 1eb519b0b..5a2dbc351 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,6 +43,7 @@ nav: - examples/aspnet.md - Modules: - modules/index.md + - modules/db2.md - modules/elasticsearch.md - modules/mongodb.md - modules/mssql.md From 9ed4196b4f3b3d79bf8e250231b3b7658a4aa228 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Mon, 2 Sep 2024 22:09:39 +0200 Subject: [PATCH 24/33] Add in-memory mapping and do not archive logs, no autoconfig to reduce container startup time --- src/Testcontainers.Db2/Db2Builder.cs | 15 +++++++++++++++ src/Testcontainers.Db2/Db2Configuration.cs | 5 ++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Testcontainers.Db2/Db2Builder.cs b/src/Testcontainers.Db2/Db2Builder.cs index 6ccc61fa4..3fd321a4c 100644 --- a/src/Testcontainers.Db2/Db2Builder.cs +++ b/src/Testcontainers.Db2/Db2Builder.cs @@ -19,6 +19,8 @@ public sealed class Db2Builder : ContainerBuilder /// Initializes a new instance of the class. /// @@ -106,6 +108,16 @@ public Db2Builder WithLicenseAgreement() .WithEnvironment("LICENSE", DefaultLicenseAgreement); } + /// + /// Maps the database to memory. + /// + /// A configured instance of . + public Db2Builder WithInMemoryDatabase() + { + return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultInMemoryDatabasePath)) + .WithTmpfsMount(DefaultInMemoryDatabasePath); + } + /// /// public override Db2Container Build() @@ -133,6 +145,9 @@ protected override Db2Builder Init() => base.Init() .WithUsername(DefaultUsername) .WithPassword(DefaultPassword) .WithLicenseAgreement() + .WithArchiveLogs(false) + .WithAutoconfig(false) + .WithInMemoryDatabase() .WithPrivileged(true); /// diff --git a/src/Testcontainers.Db2/Db2Configuration.cs b/src/Testcontainers.Db2/Db2Configuration.cs index 79ba433f4..ff95dc453 100644 --- a/src/Testcontainers.Db2/Db2Configuration.cs +++ b/src/Testcontainers.Db2/Db2Configuration.cs @@ -20,7 +20,8 @@ public Db2Configuration( string password = null, bool archiveLogs = false, bool autoConfig = false, - string licenseAgreement = null) + string licenseAgreement = null, + string inMemoryDatabasePath = null) { Database = database; Username = username; @@ -28,6 +29,7 @@ public Db2Configuration( ArchiveLogs = archiveLogs; AutoConfig = autoConfig; LicenseAgreement = licenseAgreement; + InMemoryDatabasePath = inMemoryDatabasePath; } /// @@ -93,4 +95,5 @@ public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) public bool AutoConfig { get; } public string LicenseAgreement { get; } + public string InMemoryDatabasePath { get; } } From 15f59efe0e5e0bece3f5f1a9ea6f630e204a2c30 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Mon, 9 Sep 2024 21:53:15 +0200 Subject: [PATCH 25/33] Use source includes for documentation --- docs/modules/db2.md | 88 ++----------------- .../Db2ContainerTest.cs | 2 + .../Testcontainers.Db2.Tests.csproj | 4 +- 3 files changed, 13 insertions(+), 81 deletions(-) diff --git a/docs/modules/db2.md b/docs/modules/db2.md index 214c50ed1..c8924d1c5 100644 --- a/docs/modules/db2.md +++ b/docs/modules/db2.md @@ -18,91 +18,19 @@ Please note: For linux there are currently some hurdles and the package Net.IBM. One way to achieve this within a test project is to extend the .csproj with a task that writes a .runsettings file. An example is given below: -```xml - - - - - - - - net8.0 - false - false - amd64 - $(MSBuildProjectDirectory)/linux.runsettings - - - - - - - - - - - - - - - -``` +=== "Example" + ```xml + --8<-- "tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj:RunSettingsGeneration" + ``` IDEs and editors may also require the following packages to run tests: `xunit.runner.visualstudio` and `Microsoft.NET.Test.Sdk`. Copy and paste the following code into a new `.cs` test file within an existing test project. -```csharp -using IBM.Data.Db2; - -namespace Testcontainers.Db2; - -public sealed class Db2ContainerTest : IAsyncLifetime -{ - private readonly Db2Container _db2Container = new Db2Builder().Build(); - - public Task InitializeAsync() - { - return _db2Container.StartAsync(); - } - - public Task DisposeAsync() - { - return _db2Container.DisposeAsync().AsTask(); - } - - [Fact] - public async Task ReadFromDb2Database() - { - // Given - using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); - - // When - connection.Open(); - - using DbCommand command = connection.CreateCommand(); - command.CommandText = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; - - var actual = await command.ExecuteScalarAsync() as int?; - Assert.Equal(1, actual.GetValueOrDefault()); - - // Then - Assert.Equal(ConnectionState.Open, connection.State); - } -} -``` +=== "Usage Example" + ```csharp + --8<-- "tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs:UseDb2Container" + ``` To execute the tests, use the command `dotnet test` from a terminal. diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index ef9b0606d..4e67214d3 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -4,6 +4,7 @@ namespace Testcontainers.Db2; public sealed class Db2ContainerTest : IAsyncLifetime { + // # --8<-- [start:UseDb2Container] private readonly Db2Container _db2Container = new Db2Builder().Build(); public Task InitializeAsync() @@ -50,4 +51,5 @@ public async Task ExecScriptReturnsSuccessful() Assert.True(0L.Equals(execResult.ExitCode), execResult.Stderr); Assert.Empty(execResult.Stderr); } + // # --8<-- [end:UseDb2Container] } diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index fcd7029eb..5b87938ce 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -1,3 +1,4 @@ + - \ No newline at end of file + + \ No newline at end of file From 86e6479bdb2d2351c9e9e43feab172f30a1a4b69 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 10 Sep 2024 21:27:54 +0200 Subject: [PATCH 26/33] Minor cleanup --- src/Testcontainers.Db2/Db2Builder.cs | 5 ++--- src/Testcontainers.Db2/Db2Configuration.cs | 18 ++++++++++++++++++ src/Testcontainers.Db2/Db2Container.cs | 4 ++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Testcontainers.Db2/Db2Builder.cs b/src/Testcontainers.Db2/Db2Builder.cs index 3fd321a4c..f8fd17849 100644 --- a/src/Testcontainers.Db2/Db2Builder.cs +++ b/src/Testcontainers.Db2/Db2Builder.cs @@ -118,14 +118,13 @@ public Db2Builder WithInMemoryDatabase() .WithTmpfsMount(DefaultInMemoryDatabasePath); } - /// /// public override Db2Container Build() { Validate(); - // By default, the base builder waits until the container is running. However, for MySql, a more advanced waiting strategy is necessary that requires access to the configured database, username and password. - // If the user does not provide a custom waiting strategy, append the default MySql waiting strategy. + // By default, the base builder waits until the container is running. However, for Db2, a more advanced waiting strategy is necessary + // If the user does not provide a custom waiting strategy, append the default Db2 waiting strategy. var db2Builder = DockerResourceConfiguration.WaitStrategies.Count() > 1 ? this : WithWaitStrategy(Wait.ForUnixContainer() diff --git a/src/Testcontainers.Db2/Db2Configuration.cs b/src/Testcontainers.Db2/Db2Configuration.cs index ff95dc453..fbde4991f 100644 --- a/src/Testcontainers.Db2/Db2Configuration.cs +++ b/src/Testcontainers.Db2/Db2Configuration.cs @@ -14,6 +14,7 @@ public sealed class Db2Configuration : ContainerConfiguration /// The Db2 archive logs setting. /// The Db2 auto config setting. /// The Db2 license agreement. + /// The Db2 database path to map into memory (tmpfs). public Db2Configuration( string database = null, string username = null, @@ -73,6 +74,10 @@ public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database); Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username); Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password); + ArchiveLogs = BuildConfiguration.Combine(oldValue.ArchiveLogs, newValue.ArchiveLogs); + AutoConfig = BuildConfiguration.Combine(oldValue.AutoConfig, newValue.AutoConfig); + LicenseAgreement = BuildConfiguration.Combine(oldValue.LicenseAgreement, newValue.LicenseAgreement); + InMemoryDatabasePath = BuildConfiguration.Combine(oldValue.InMemoryDatabasePath, newValue.InMemoryDatabasePath); } /// @@ -90,10 +95,23 @@ public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) /// public string Password { get; } + /// + /// Toggle for archivation of logs. + /// public bool ArchiveLogs { get; } + /// + /// Toggle for database autoconfiguration. + /// public bool AutoConfig { get; } + /// + /// License agreement value. + /// public string LicenseAgreement { get; } + + /// + /// Path to the database files that should be mapped into memory (tmpfs). + /// public string InMemoryDatabasePath { get; } } diff --git a/src/Testcontainers.Db2/Db2Container.cs b/src/Testcontainers.Db2/Db2Container.cs index 3c5d9036c..a81469b02 100644 --- a/src/Testcontainers.Db2/Db2Container.cs +++ b/src/Testcontainers.Db2/Db2Container.cs @@ -20,7 +20,7 @@ public Db2Container(Db2Configuration configuration) : base(configuration) } public string GetConnectionString() => new StringBuilder() - .Append("Server=").Append(Hostname).Append(":").Append(GetMappedPublicPort(Db2Builder.Db2Port).ToString()).Append(ConnectionStringDelimiter) + .Append("Server=").Append(Hostname).Append(':').Append(GetMappedPublicPort(Db2Builder.Db2Port).ToString()).Append(ConnectionStringDelimiter) .Append("Database=").Append(_configuration.Database).Append(ConnectionStringDelimiter) .Append("UID=").Append(_configuration.Username).Append(ConnectionStringDelimiter) .Append("PWD=").Append(_configuration.Password).Append(ConnectionStringDelimiter) @@ -32,7 +32,7 @@ public async Task ExecScriptAsync(string scriptContent, Cancellation .Append(Db2CommandPath).Append(" connect to ").Append(_configuration.Database) .Append(" user ").Append(_configuration.Username).Append(" using ").Append(_configuration.Password) .Append("; ") - .Append(Db2CommandPath).Append(" ").Append(scriptContent) + .Append(Db2CommandPath).Append(' ').Append(scriptContent) .ToString() ]; From 34157340719dfae78fc80bc94b9cd39764d28b65 Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 1 Oct 2024 20:58:01 +0200 Subject: [PATCH 27/33] Remoe no longer existing papercut module from solution file after wrong merge conflict resolution --- Testcontainers.sln | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Testcontainers.sln b/Testcontainers.sln index f63de0312..f4606170c 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -79,8 +79,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle", "src\Testcontainers.Oracle\Testcontainers.Oracle.csproj", "{596EAFC1-0496-495C-B382-D57415FA456A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{464F1120-A0DA-462B-B9E8-45176D883625}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PubSub", "src\Testcontainers.PubSub\Testcontainers.PubSub.csproj", "{E6642255-667D-476B-B584-089AA5E6C0B1}" @@ -171,8 +169,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j.Tests" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle.Tests", "tests\Testcontainers.Oracle.Tests\Testcontainers.Oracle.Tests.csproj", "{4AC1088B-9965-4497-AC8E-570F1AD5631F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{904C8476-FCEF-41F0-8948-9EFA7C08712E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Windows.Tests", "tests\Testcontainers.Platform.Windows.Tests\Testcontainers.Platform.Windows.Tests.csproj", "{3E55CBE8-AFE8-426D-9470-49D63CD1051C}" From 8bff4521bd51dca7c7d6d0351e8daf3d11794d2a Mon Sep 17 00:00:00 2001 From: k3v1n Date: Tue, 1 Oct 2024 21:13:31 +0200 Subject: [PATCH 28/33] Remove no longer existing sql edge project from solution --- Testcontainers.sln | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Testcontainers.sln b/Testcontainers.sln index f4606170c..d2d4e2f9d 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -93,8 +93,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redis", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda", "src\Testcontainers.Redpanda\Testcontainers.Redpanda.csproj", "{45D6F69C-4D87-4130-AA90-0DB2F7460DAE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.SqlEdge", "src\Testcontainers.SqlEdge\Testcontainers.SqlEdge.csproj", "{C95A3B2F-2B28-49A7-8806-731C158BBC21}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" @@ -189,8 +187,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda.Tes EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ResourceReaper.Tests", "tests\Testcontainers.ResourceReaper.Tests\Testcontainers.ResourceReaper.Tests.csproj", "{9E8E6AA5-65D1-498F-BEAB-BA34723A0050}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.SqlEdge.Tests", "tests\Testcontainers.SqlEdge.Tests\Testcontainers.SqlEdge.Tests.csproj", "{1A1983E6-5297-435F-B467-E8E1F11277D6}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}" From b8254fdf043180d4075e8b517a9da5a40381f564 Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:28:56 +0100 Subject: [PATCH 29/33] chore: Merge develop, align repo standards --- .github/workflows/cicd.yml | 1 + Directory.Packages.props | 4 +- Testcontainers.sln | 52 +-- src/Testcontainers.Db2/Db2Builder.cs | 357 +++++++++--------- src/Testcontainers.Db2/Db2Configuration.cs | 185 +++++---- src/Testcontainers.Db2/Db2Container.cs | 46 ++- .../Testcontainers.Db2.csproj | 22 +- src/Testcontainers.Db2/Usings.cs | 8 +- .../Db2ContainerTest.cs | 100 +++-- .../Testcontainers.Db2.Tests.csproj | 46 +-- .../Testcontainers.Db2.Tests.targets | 22 ++ tests/Testcontainers.Db2.Tests/Usings.cs | 3 +- .../linux.runsettings | 16 +- 13 files changed, 433 insertions(+), 429 deletions(-) create mode 100644 tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index f2e1e531b..0d69bae73 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -48,6 +48,7 @@ jobs: { name: "Testcontainers.CosmosDb", runs-on: "ubuntu-22.04" }, { name: "Testcontainers.Couchbase", runs-on: "ubuntu-22.04" }, { name: "Testcontainers.CouchDb", runs-on: "ubuntu-22.04" }, + { name: "Testcontainers.Db2", runs-on: "ubuntu-22.04" }, { name: "Testcontainers.DynamoDb", runs-on: "ubuntu-22.04" }, { name: "Testcontainers.Elasticsearch", runs-on: "ubuntu-22.04" }, { name: "Testcontainers.EventStoreDb", runs-on: "ubuntu-22.04" }, diff --git a/Directory.Packages.props b/Directory.Packages.props index 335ebf0ca..7d9ef6146 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -41,8 +41,8 @@ - - + + diff --git a/Testcontainers.sln b/Testcontainers.sln index f7627cefe..27c8be5bd 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -35,6 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Couchbase", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CouchDb", "src\Testcontainers.CouchDb\Testcontainers.CouchDb.csproj", "{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Db2", "src\Testcontainers.Db2\Testcontainers.Db2.csproj", "{ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.DynamoDb", "src\Testcontainers.DynamoDb\Testcontainers.DynamoDb.csproj", "{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}" @@ -79,9 +81,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle", "src\Testcontainers.Oracle\Testcontainers.Oracle.csproj", "{596EAFC1-0496-495C-B382-D57415FA456A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{B2608563-8EE4-49AA-A9A0-B1614486AEEF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{B2608563-8EE4-49AA-A9A0-B1614486AEEF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PubSub", "src\Testcontainers.PubSub\Testcontainers.PubSub.csproj", "{E6642255-667D-476B-B584-089AA5E6C0B1}" EndProject @@ -95,15 +97,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redis", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda", "src\Testcontainers.Redpanda\Testcontainers.Redpanda.csproj", "{45D6F69C-4D87-4130-AA90-0DB2F7460DAE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ServiceBus", "src\Testcontainers.ServiceBus\Testcontainers.ServiceBus.csproj", "{2E39E532-B81E-4B48-A004-FAE18EDF9E79}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ServiceBus", "src\Testcontainers.ServiceBus\Testcontainers.ServiceBus.csproj", "{2E39E532-B81E-4B48-A004-FAE18EDF9E79}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit", "src\Testcontainers.Xunit\Testcontainers.Xunit.csproj", "{380BB29B-F556-404D-B13B-CA250599C565}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Xunit", "src\Testcontainers.Xunit\Testcontainers.Xunit.csproj", "{380BB29B-F556-404D-B13B-CA250599C565}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.XunitV3", "src\Testcontainers.XunitV3\Testcontainers.XunitV3.csproj", "{84911C93-C2A9-46E9-AE5E-D567306589E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.XunitV3", "src\Testcontainers.XunitV3\Testcontainers.XunitV3.csproj", "{84911C93-C2A9-46E9-AE5E-D567306589E5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ActiveMq.Tests", "tests\Testcontainers.ActiveMq.Tests\Testcontainers.ActiveMq.Tests.csproj", "{AB93C67F-0A53-4525-AE6C-29B065820ABE}" EndProject @@ -131,6 +133,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CouchDb.Test EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Databases.Tests", "tests\Testcontainers.Databases.Tests\Testcontainers.Databases.Tests.csproj", "{DA54916E-1128-4200-B6AE-9F5BF02D832D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Db2.Tests", "tests\Testcontainers.Db2.Tests\Testcontainers.Db2.Tests.csproj", "{AF9853AB-86E7-49DE-8DF8-454838E90D6F}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.DynamoDb.Tests", "tests\Testcontainers.DynamoDb.Tests\Testcontainers.DynamoDb.Tests.csproj", "{101515E6-74C1-40F9-85C8-871F742A378D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}" @@ -175,9 +179,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j.Tests" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle.Tests", "tests\Testcontainers.Oracle.Tests\Testcontainers.Oracle.Tests.csproj", "{4AC1088B-9965-4497-AC8E-570F1AD5631F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{F03FA970-BE2B-4AE2-96FE-7E1F805CEA20}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{F03FA970-BE2B-4AE2-96FE-7E1F805CEA20}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Windows.Tests", "tests\Testcontainers.Platform.Windows.Tests\Testcontainers.Platform.Windows.Tests.csproj", "{3E55CBE8-AFE8-426D-9470-49D63CD1051C}" EndProject @@ -197,17 +201,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda.Tes EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ResourceReaper.Tests", "tests\Testcontainers.ResourceReaper.Tests\Testcontainers.ResourceReaper.Tests.csproj", "{9E8E6AA5-65D1-498F-BEAB-BA34723A0050}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ServiceBus.Tests", "tests\Testcontainers.ServiceBus.Tests\Testcontainers.ServiceBus.Tests.csproj", "{232DD918-46ED-4BA8-B383-1A9146D83064}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ServiceBus.Tests", "tests\Testcontainers.ServiceBus.Tests\Testcontainers.ServiceBus.Tests.csproj", "{232DD918-46ED-4BA8-B383-1A9146D83064}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Db2", "src\Testcontainers.Db2\Testcontainers.Db2.csproj", "{ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Db2.Tests", "tests\Testcontainers.Db2.Tests\Testcontainers.Db2.Tests.csproj", "{AF9853AB-86E7-49DE-8DF8-454838E90D6F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -259,6 +259,10 @@ Global {DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}.Debug|Any CPU.Build.0 = Debug|Any CPU {DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}.Release|Any CPU.ActiveCfg = Release|Any CPU {DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}.Release|Any CPU.Build.0 = Release|Any CPU + {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Release|Any CPU.Build.0 = Release|Any CPU {2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -451,6 +455,10 @@ Global {DA54916E-1128-4200-B6AE-9F5BF02D832D}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA54916E-1128-4200-B6AE-9F5BF02D832D}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA54916E-1128-4200-B6AE-9F5BF02D832D}.Release|Any CPU.Build.0 = Release|Any CPU + {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Release|Any CPU.Build.0 = Release|Any CPU {101515E6-74C1-40F9-85C8-871F742A378D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {101515E6-74C1-40F9-85C8-871F742A378D}.Debug|Any CPU.Build.0 = Debug|Any CPU {101515E6-74C1-40F9-85C8-871F742A378D}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -599,14 +607,6 @@ Global {E901DF14-6F05-4FC2-825A-3055FAD33561}.Debug|Any CPU.Build.0 = Debug|Any CPU {E901DF14-6F05-4FC2-825A-3055FAD33561}.Release|Any CPU.ActiveCfg = Release|Any CPU {E901DF14-6F05-4FC2-825A-3055FAD33561}.Release|Any CPU.Build.0 = Release|Any CPU - {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}.Release|Any CPU.Build.0 = Release|Any CPU - {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF9853AB-86E7-49DE-8DF8-454838E90D6F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {5365F780-0E6C-41F0-B1B9-7DC34368F80C} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} @@ -620,6 +620,7 @@ Global {A724806F-8C94-4438-8011-04A9A1575318} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} {58E94721-2681-4D82-8D94-0B2F9DB0D575} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} {DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} + {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} {2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} {641DDEA5-B6E0-41E6-BA11-7A28C0913127} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} {84D707E0-C9FA-4327-85DC-0AFEBEA73572} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} @@ -668,6 +669,7 @@ Global {809322BA-D690-4F2B-B884-23F895663963} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {E4520FB1-4466-4DCA-AD08-4075102C68D3} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {DA54916E-1128-4200-B6AE-9F5BF02D832D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} + {AF9853AB-86E7-49DE-8DF8-454838E90D6F} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {101515E6-74C1-40F9-85C8-871F742A378D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {DD5B3678-468F-4D73-AECE-705E3D66CD43} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} @@ -705,7 +707,5 @@ Global {27CDB869-A150-4593-958F-6F26E5391E7C} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} {E901DF14-6F05-4FC2-825A-3055FAD33561} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} - {ED3C611F-DFE2-4AB7-A323-B500E95B4FF9} = {673F23AE-7694-4BB9-ABD4-136D6C13634E} - {AF9853AB-86E7-49DE-8DF8-454838E90D6F} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF} EndGlobalSection EndGlobal diff --git a/src/Testcontainers.Db2/Db2Builder.cs b/src/Testcontainers.Db2/Db2Builder.cs index f8fd17849..322c30c53 100644 --- a/src/Testcontainers.Db2/Db2Builder.cs +++ b/src/Testcontainers.Db2/Db2Builder.cs @@ -1,143 +1,140 @@ -using System.Linq; -using System.Threading.Tasks; - namespace Testcontainers.Db2; /// [PublicAPI] public sealed class Db2Builder : ContainerBuilder { - public const string Db2Image = "icr.io/db2_community/db2:latest"; - - public const ushort Db2Port = 50000; - - public const string DefaultDatabase = "test"; - - public const string DefaultUsername = "db2inst1"; - - public const string DefaultPassword = "test123"; - - public const string DefaultLicenseAgreement = "accept"; - - public const string DefaultInMemoryDatabasePath = "/home/db2inst1/data"; - - /// - /// Initializes a new instance of the class. - /// - public Db2Builder() - : this(new Db2Configuration()) - { - DockerResourceConfiguration = Init().DockerResourceConfiguration; - } - - /// - /// Initializes a new instance of the class. - /// - /// The Docker resource configuration. - private Db2Builder(Db2Configuration resourceConfiguration) - : base(resourceConfiguration) - { - DockerResourceConfiguration = resourceConfiguration; - } - - /// - protected override Db2Configuration DockerResourceConfiguration { get; } - - /// - /// Sets the Db2 database name. - /// - /// The Db2 database. - /// A configured instance of . - public Db2Builder WithDatabase(string database) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(database: database)) - .WithEnvironment("DBNAME", database); - } - - /// - /// Sets the Db2 username. - /// - /// The Db2 username. - /// A configured instance of . - public Db2Builder WithUsername(string username) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(username: username)) - .WithEnvironment("DB2INSTANCE", username); - } - - /// - /// Sets the Db2 password. - /// - /// The Db2 password. - /// A configured instance of . - public Db2Builder WithPassword(string password) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(password: password)) - .WithEnvironment("DB2INST1_PASSWORD", password); - } - - /// - /// Sets the Db2 archive logs. - /// - /// The Db2 archive logs setting. - /// A configured instance of . - public Db2Builder WithArchiveLogs(bool archiveLogs) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(archiveLogs: archiveLogs)) - .WithEnvironment("ARCHIVE_LOGS", archiveLogs.ToString()); - } - - /// - /// Sets the Db2 autoconfig setting. - /// - /// The Db2 autoconfig setting. - /// A configured instance of . - public Db2Builder WithAutoconfig(bool autoConfig) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(autoConfig: autoConfig)) - .WithEnvironment("AUTOCONFIG", autoConfig.ToString()); - } - - /// - /// Accepts the Db2 license agreement. - /// - /// A configured instance of . - public Db2Builder WithLicenseAgreement() - { - return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultLicenseAgreement)) - .WithEnvironment("LICENSE", DefaultLicenseAgreement); - } - - /// - /// Maps the database to memory. - /// - /// A configured instance of . - public Db2Builder WithInMemoryDatabase() - { - return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultInMemoryDatabasePath)) - .WithTmpfsMount(DefaultInMemoryDatabasePath); - } - - /// - public override Db2Container Build() - { - Validate(); - - // By default, the base builder waits until the container is running. However, for Db2, a more advanced waiting strategy is necessary - // If the user does not provide a custom waiting strategy, append the default Db2 waiting strategy. - var db2Builder = DockerResourceConfiguration.WaitStrategies.Count() > 1 - ? this - : WithWaitStrategy(Wait.ForUnixContainer() - .UntilMessageIsLogged("All databases are now active") - .UntilMessageIsLogged("Setup has completed.") - .AddCustomWaitStrategy(new WaitUntil(DockerResourceConfiguration)) - ); - - return new Db2Container(db2Builder.DockerResourceConfiguration); - } - - /// - protected override Db2Builder Init() => base.Init() + public const string Db2Image = "icr.io/db2_community/db2:latest"; + + public const ushort Db2Port = 50000; + + public const string DefaultDatabase = "test"; + + public const string DefaultUsername = "db2inst1"; + + public const string DefaultPassword = "db2inst1"; + + public const string DefaultLicenseAgreement = "accept"; + + public const string DefaultInMemoryDatabasePath = "/home/db2inst1/data"; + + /// + /// Initializes a new instance of the class. + /// + public Db2Builder() + : this(new Db2Configuration()) + { + DockerResourceConfiguration = Init().DockerResourceConfiguration; + } + + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + private Db2Builder(Db2Configuration resourceConfiguration) + : base(resourceConfiguration) + { + DockerResourceConfiguration = resourceConfiguration; + } + + /// + protected override Db2Configuration DockerResourceConfiguration { get; } + + /// + /// Sets the Db2 database name. + /// + /// The Db2 database. + /// A configured instance of . + public Db2Builder WithDatabase(string database) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(database: database)) + .WithEnvironment("DBNAME", database); + } + + /// + /// Sets the Db2 username. + /// + /// The Db2 username. + /// A configured instance of . + public Db2Builder WithUsername(string username) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(username: username)) + .WithEnvironment("DB2INSTANCE", username); + } + + /// + /// Sets the Db2 password. + /// + /// The Db2 password. + /// A configured instance of . + public Db2Builder WithPassword(string password) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(password: password)) + .WithEnvironment("DB2INST1_PASSWORD", password); + } + + /// + /// Sets the Db2 archive logs. + /// + /// The Db2 archive logs setting. + /// A configured instance of . + public Db2Builder WithArchiveLogs(bool archiveLogs) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(archiveLogs: archiveLogs)) + .WithEnvironment("ARCHIVE_LOGS", archiveLogs.ToString()); + } + + /// + /// Sets the Db2 autoconfig setting. + /// + /// The Db2 autoconfig setting. + /// A configured instance of . + public Db2Builder WithAutoconfig(bool autoConfig) + { + return Merge(DockerResourceConfiguration, new Db2Configuration(autoConfig: autoConfig)) + .WithEnvironment("AUTOCONFIG", autoConfig.ToString()); + } + + /// + /// Accepts the Db2 license agreement. + /// + /// A configured instance of . + public Db2Builder WithLicenseAgreement() + { + return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultLicenseAgreement)) + .WithEnvironment("LICENSE", DefaultLicenseAgreement); + } + + /// + /// Maps the database to memory. + /// + /// A configured instance of . + public Db2Builder WithInMemoryDatabase() + { + return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultInMemoryDatabasePath)) + .WithTmpfsMount(DefaultInMemoryDatabasePath); + } + + /// + public override Db2Container Build() + { + Validate(); + + // By default, the base builder waits until the container is running. However, for Db2, a more advanced waiting strategy is necessary + // If the user does not provide a custom waiting strategy, append the default Db2 waiting strategy. + var db2Builder = DockerResourceConfiguration.WaitStrategies.Count() > 1 + ? this + : WithWaitStrategy(Wait.ForUnixContainer() + .UntilMessageIsLogged("All databases are now active") + .UntilMessageIsLogged("Setup has completed.") + .AddCustomWaitStrategy(new WaitUntil(DockerResourceConfiguration)) + ); + + return new Db2Container(db2Builder.DockerResourceConfiguration); + } + + /// + protected override Db2Builder Init() => base.Init() .WithImage(Db2Image) .WithPortBinding(Db2Port, true) .WithDatabase(DefaultDatabase) @@ -149,57 +146,57 @@ protected override Db2Builder Init() => base.Init() .WithInMemoryDatabase() .WithPrivileged(true); - /// - protected override void Validate() - { - base.Validate(); - - _ = Guard.Argument(DockerResourceConfiguration.Username, nameof(DockerResourceConfiguration.Username)) - .NotNull() - .NotEmpty(); - - _ = Guard.Argument(DockerResourceConfiguration.Password, nameof(DockerResourceConfiguration.Password)) - .NotNull() - .NotEmpty(); - } - - /// - protected override Db2Builder Clone(IResourceConfiguration resourceConfiguration) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(resourceConfiguration)); - } - - /// - protected override Db2Builder Clone(IContainerConfiguration resourceConfiguration) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(resourceConfiguration)); - } - - /// - protected override Db2Builder Merge(Db2Configuration oldValue, Db2Configuration newValue) - { - return new Db2Builder(new Db2Configuration(oldValue, newValue)); - } - - /// - private sealed class WaitUntil : IWaitUntil - { - /// - /// Initializes a new instance of the class. - /// - /// The container configuration. - public WaitUntil(Db2Configuration configuration) + /// + protected override void Validate() + { + base.Validate(); + + _ = Guard.Argument(DockerResourceConfiguration.Username, nameof(DockerResourceConfiguration.Username)) + .NotNull() + .NotEmpty(); + + _ = Guard.Argument(DockerResourceConfiguration.Password, nameof(DockerResourceConfiguration.Password)) + .NotNull() + .NotEmpty(); + } + + /// + protected override Db2Builder Clone(IResourceConfiguration resourceConfiguration) { + return Merge(DockerResourceConfiguration, new Db2Configuration(resourceConfiguration)); } /// - public async Task UntilAsync(IContainer container) + protected override Db2Builder Clone(IContainerConfiguration resourceConfiguration) { - var db2Container = (Db2Container)container; + return Merge(DockerResourceConfiguration, new Db2Configuration(resourceConfiguration)); + } - var execResult = await db2Container.ExecScriptAsync("SELECT 1 FROM SYSIBM.SYSDUMMY1").ConfigureAwait(false); + /// + protected override Db2Builder Merge(Db2Configuration oldValue, Db2Configuration newValue) + { + return new Db2Builder(new Db2Configuration(oldValue, newValue)); + } - return 0L.Equals(execResult.ExitCode); + /// + private sealed class WaitUntil : IWaitUntil + { + /// + /// Initializes a new instance of the class. + /// + /// The container configuration. + public WaitUntil(Db2Configuration configuration) + { + } + + /// + public async Task UntilAsync(IContainer container) + { + var db2Container = (Db2Container)container; + + var execResult = await db2Container.ExecScriptAsync("SELECT 1 FROM SYSIBM.SYSDUMMY1").ConfigureAwait(false); + + return 0L.Equals(execResult.ExitCode); + } } - } -} +} \ No newline at end of file diff --git a/src/Testcontainers.Db2/Db2Configuration.cs b/src/Testcontainers.Db2/Db2Configuration.cs index fbde4991f..e761990d0 100644 --- a/src/Testcontainers.Db2/Db2Configuration.cs +++ b/src/Testcontainers.Db2/Db2Configuration.cs @@ -4,18 +4,17 @@ namespace Testcontainers.Db2; [PublicAPI] public sealed class Db2Configuration : ContainerConfiguration { - - /// - /// Initializes a new instance of the class. - /// - /// The Db2 database. - /// The Db2 username. - /// The Db2 password. - /// The Db2 archive logs setting. - /// The Db2 auto config setting. - /// The Db2 license agreement. - /// The Db2 database path to map into memory (tmpfs). - public Db2Configuration( + /// + /// Initializes a new instance of the class. + /// + /// The Db2 database. + /// The Db2 username. + /// The Db2 password. + /// The Db2 archive logs setting. + /// The Db2 auto config setting. + /// The Db2 license agreement. + /// The Db2 database path to map into memory (tmpfs). + public Db2Configuration( string database = null, string username = null, string password = null, @@ -23,95 +22,95 @@ public Db2Configuration( bool autoConfig = false, string licenseAgreement = null, string inMemoryDatabasePath = null) - { - Database = database; - Username = username; - Password = password; - ArchiveLogs = archiveLogs; - AutoConfig = autoConfig; - LicenseAgreement = licenseAgreement; - InMemoryDatabasePath = inMemoryDatabasePath; - } + { + Database = database; + Username = username; + Password = password; + ArchiveLogs = archiveLogs; + AutoConfig = autoConfig; + LicenseAgreement = licenseAgreement; + InMemoryDatabasePath = inMemoryDatabasePath; + } - /// - /// Initializes a new instance of the class. - /// - /// The Docker resource configuration. - public Db2Configuration(IResourceConfiguration resourceConfiguration) - : base(resourceConfiguration) - { - // Passes the configuration upwards to the base implementations to create an updated immutable copy. - } + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + public Db2Configuration(IResourceConfiguration resourceConfiguration) + : base(resourceConfiguration) + { + // Passes the configuration upwards to the base implementations to create an updated immutable copy. + } - /// - /// Initializes a new instance of the class. - /// - /// The Docker resource configuration. - public Db2Configuration(IContainerConfiguration resourceConfiguration) - : base(resourceConfiguration) - { - // Passes the configuration upwards to the base implementations to create an updated immutable copy. - } + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + public Db2Configuration(IContainerConfiguration resourceConfiguration) + : base(resourceConfiguration) + { + // Passes the configuration upwards to the base implementations to create an updated immutable copy. + } - /// - /// Initializes a new instance of the class. - /// - /// The Docker resource configuration. - public Db2Configuration(Db2Configuration resourceConfiguration) - : this(new Db2Configuration(), resourceConfiguration) - { - // Passes the configuration upwards to the base implementations to create an updated immutable copy. - } + /// + /// Initializes a new instance of the class. + /// + /// The Docker resource configuration. + public Db2Configuration(Db2Configuration resourceConfiguration) + : this(new Db2Configuration(), resourceConfiguration) + { + // Passes the configuration upwards to the base implementations to create an updated immutable copy. + } - /// - /// Initializes a new instance of the class. - /// - /// The old Docker resource configuration. - /// The new Docker resource configuration. - public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) - : base(oldValue, newValue) - { - Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database); - Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username); - Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password); - ArchiveLogs = BuildConfiguration.Combine(oldValue.ArchiveLogs, newValue.ArchiveLogs); - AutoConfig = BuildConfiguration.Combine(oldValue.AutoConfig, newValue.AutoConfig); - LicenseAgreement = BuildConfiguration.Combine(oldValue.LicenseAgreement, newValue.LicenseAgreement); - InMemoryDatabasePath = BuildConfiguration.Combine(oldValue.InMemoryDatabasePath, newValue.InMemoryDatabasePath); - } + /// + /// Initializes a new instance of the class. + /// + /// The old Docker resource configuration. + /// The new Docker resource configuration. + public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) + : base(oldValue, newValue) + { + Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database); + Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username); + Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password); + ArchiveLogs = BuildConfiguration.Combine(oldValue.ArchiveLogs, newValue.ArchiveLogs); + AutoConfig = BuildConfiguration.Combine(oldValue.AutoConfig, newValue.AutoConfig); + LicenseAgreement = BuildConfiguration.Combine(oldValue.LicenseAgreement, newValue.LicenseAgreement); + InMemoryDatabasePath = BuildConfiguration.Combine(oldValue.InMemoryDatabasePath, newValue.InMemoryDatabasePath); + } - /// - /// Gets the Db2 database. - /// - public string Database { get; } + /// + /// Gets the Db2 database. + /// + public string Database { get; } - /// - /// Gets the Db2 username. - /// - public string Username { get; } + /// + /// Gets the Db2 username. + /// + public string Username { get; } - /// - /// Gets the Db2 password. - /// - public string Password { get; } + /// + /// Gets the Db2 password. + /// + public string Password { get; } - /// - /// Toggle for archivation of logs. - /// - public bool ArchiveLogs { get; } + /// + /// Toggle for archivation of logs. + /// + public bool ArchiveLogs { get; } - /// - /// Toggle for database autoconfiguration. - /// - public bool AutoConfig { get; } + /// + /// Toggle for database autoconfiguration. + /// + public bool AutoConfig { get; } - /// - /// License agreement value. - /// - public string LicenseAgreement { get; } + /// + /// License agreement value. + /// + public string LicenseAgreement { get; } - /// - /// Path to the database files that should be mapped into memory (tmpfs). - /// - public string InMemoryDatabasePath { get; } -} + /// + /// Path to the database files that should be mapped into memory (tmpfs). + /// + public string InMemoryDatabasePath { get; } +} \ No newline at end of file diff --git a/src/Testcontainers.Db2/Db2Container.cs b/src/Testcontainers.Db2/Db2Container.cs index a81469b02..7e55509f4 100644 --- a/src/Testcontainers.Db2/Db2Container.cs +++ b/src/Testcontainers.Db2/Db2Container.cs @@ -1,13 +1,9 @@ -using System.Text; -using System.Threading; -using System.Threading.Tasks; +namespace Testcontainers.Db2; -namespace Testcontainers.Db2 +/// +[PublicAPI] +public sealed class Db2Container : DockerContainer, IDatabaseContainer { - /// - [PublicAPI] - public sealed class Db2Container : DockerContainer, IDatabaseContainer - { private static string Db2CommandPath = "/opt/ibm/db2/*/bin/db2"; private readonly Db2Configuration _configuration; @@ -16,27 +12,29 @@ public sealed class Db2Container : DockerContainer, IDatabaseContainer public Db2Container(Db2Configuration configuration) : base(configuration) { - _configuration = configuration; + _configuration = configuration; } public string GetConnectionString() => new StringBuilder() - .Append("Server=").Append(Hostname).Append(':').Append(GetMappedPublicPort(Db2Builder.Db2Port).ToString()).Append(ConnectionStringDelimiter) - .Append("Database=").Append(_configuration.Database).Append(ConnectionStringDelimiter) - .Append("UID=").Append(_configuration.Username).Append(ConnectionStringDelimiter) - .Append("PWD=").Append(_configuration.Password).Append(ConnectionStringDelimiter) - .ToString(); + .Append("Server=").Append(Hostname).Append(':').Append(GetMappedPublicPort(Db2Builder.Db2Port).ToString()) + .Append(ConnectionStringDelimiter) + .Append("Database=").Append(_configuration.Database).Append(ConnectionStringDelimiter) + .Append("UID=").Append(_configuration.Username).Append(ConnectionStringDelimiter) + .Append("PWD=").Append(_configuration.Password).Append(ConnectionStringDelimiter) + .ToString(); public async Task ExecScriptAsync(string scriptContent, CancellationToken cancellationToken = default) { - string[] command = ["su", "db2inst1", "-c", new StringBuilder() - .Append(Db2CommandPath).Append(" connect to ").Append(_configuration.Database) - .Append(" user ").Append(_configuration.Username).Append(" using ").Append(_configuration.Password) - .Append("; ") - .Append(Db2CommandPath).Append(' ').Append(scriptContent) - .ToString() - ]; + string[] command = + [ + "su", "db2inst1", "-c", new StringBuilder() + .Append(Db2CommandPath).Append(" connect to ").Append(_configuration.Database) + .Append(" user ").Append(_configuration.Username).Append(" using ").Append(_configuration.Password) + .Append("; ") + .Append(Db2CommandPath).Append(' ').Append(scriptContent) + .ToString() + ]; - return await ExecAsync(command).ConfigureAwait(false); + return await ExecAsync(command).ConfigureAwait(false); } - } -} +} \ No newline at end of file diff --git a/src/Testcontainers.Db2/Testcontainers.Db2.csproj b/src/Testcontainers.Db2/Testcontainers.Db2.csproj index 7a7ebd95d..9a25b9c4d 100644 --- a/src/Testcontainers.Db2/Testcontainers.Db2.csproj +++ b/src/Testcontainers.Db2/Testcontainers.Db2.csproj @@ -1,12 +1,12 @@ - - net6.0;net8.0;netstandard2.0;netstandard2.1 - latest - - - - - - - - + + net8.0;net9.0;netstandard2.0;netstandard2.1 + latest + + + + + + + + \ No newline at end of file diff --git a/src/Testcontainers.Db2/Usings.cs b/src/Testcontainers.Db2/Usings.cs index 6d8716201..7a1babb38 100644 --- a/src/Testcontainers.Db2/Usings.cs +++ b/src/Testcontainers.Db2/Usings.cs @@ -1,7 +1,11 @@ +global using System; +global using System.Linq; +global using System.Text; +global using System.Threading; +global using System.Threading.Tasks; global using Docker.DotNet.Models; global using DotNet.Testcontainers; global using DotNet.Testcontainers.Builders; global using DotNet.Testcontainers.Configurations; global using DotNet.Testcontainers.Containers; -global using JetBrains.Annotations; -global using System; +global using JetBrains.Annotations; \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index 4e67214d3..e5b21ef2a 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -1,55 +1,53 @@ -using IBM.Data.Db2; - namespace Testcontainers.Db2; public sealed class Db2ContainerTest : IAsyncLifetime { - // # --8<-- [start:UseDb2Container] - private readonly Db2Container _db2Container = new Db2Builder().Build(); - - public Task InitializeAsync() - { - return _db2Container.StartAsync(); - } - - public Task DisposeAsync() - { - return _db2Container.DisposeAsync().AsTask(); - } - - [Fact] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] - public async Task ReadFromDb2Database() - { - // Given - using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); - - // When - connection.Open(); - - using DbCommand command = connection.CreateCommand(); - command.CommandText = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; - - var actual = await command.ExecuteScalarAsync() as int?; - Assert.Equal(1, actual.GetValueOrDefault()); - - // Then - Assert.Equal(ConnectionState.Open, connection.State); - } - - [Fact] - [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] - public async Task ExecScriptReturnsSuccessful() - { - // Given - const string scriptContent = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; - - // When - var execResult = await _db2Container.ExecScriptAsync(scriptContent); - - // Then - Assert.True(0L.Equals(execResult.ExitCode), execResult.Stderr); - Assert.Empty(execResult.Stderr); - } - // # --8<-- [end:UseDb2Container] -} + // # --8<-- [start:UseDb2Container] + private readonly Db2Container _db2Container = new Db2Builder().Build(); + + public Task InitializeAsync() + { + return _db2Container.StartAsync(); + } + + public Task DisposeAsync() + { + return _db2Container.DisposeAsync().AsTask(); + } + + [Fact] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] + public async Task ReadFromDb2Database() + { + // Given + using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); + + // When + connection.Open(); + + using DbCommand command = connection.CreateCommand(); + command.CommandText = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; + + var actual = await command.ExecuteScalarAsync() as int?; + Assert.Equal(1, actual.GetValueOrDefault()); + + // Then + Assert.Equal(ConnectionState.Open, connection.State); + } + + [Fact] + [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] + public async Task ExecScriptReturnsSuccessful() + { + // Given + const string scriptContent = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; + + // When + var execResult = await _db2Container.ExecScriptAsync(scriptContent); + + // Then + Assert.True(0L.Equals(execResult.ExitCode), execResult.Stderr); + Assert.Empty(execResult.Stderr); + } + // # --8<-- [end:UseDb2Container] +} \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index 5b344a196..024d95cb7 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -1,40 +1,24 @@ - - - - - - - net8.0 + net9.0 false false - amd64 - $(MSBuildProjectDirectory)/linux.runsettings - - - - - - + + + + + + + + + + - - + + - - \ No newline at end of file + + \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets new file mode 100644 index 000000000..32b2c12b2 --- /dev/null +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets @@ -0,0 +1,22 @@ + + + $(MSBuildProjectDirectory)/linux.runsettings + + + + + + + \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Usings.cs b/tests/Testcontainers.Db2.Tests/Usings.cs index 7b43902c3..dbf73bb31 100644 --- a/tests/Testcontainers.Db2.Tests/Usings.cs +++ b/tests/Testcontainers.Db2.Tests/Usings.cs @@ -1,5 +1,6 @@ -global using DotNet.Testcontainers.Commons; global using System.Data; global using System.Data.Common; global using System.Threading.Tasks; +global using DotNet.Testcontainers.Commons; +global using IBM.Data.Db2; global using Xunit; \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/linux.runsettings b/tests/Testcontainers.Db2.Tests/linux.runsettings index 451ec8843..71fa659a1 100644 --- a/tests/Testcontainers.Db2.Tests/linux.runsettings +++ b/tests/Testcontainers.Db2.Tests/linux.runsettings @@ -1,10 +1,10 @@ - + - - - Filled by msbuild - Filled by msbuild - Filled by msbuild - - + + + Filled by msbuild + Filled by msbuild + Filled by msbuild + + \ No newline at end of file From 55ae22dd1dd1fc897d3a2afaea7dc3602dc55fef Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:49:05 +0100 Subject: [PATCH 30/33] chore: Revert sln changes --- Testcontainers.sln | 196 +++++++++--------- .../linux.runsettings | 6 +- 2 files changed, 101 insertions(+), 101 deletions(-) diff --git a/Testcontainers.sln b/Testcontainers.sln index 27c8be5bd..f2300b06c 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -13,201 +13,201 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{673F23AE-769 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ActiveMq", "src\Testcontainers.ActiveMq\Testcontainers.ActiveMq.csproj", "{5365F780-0E6C-41F0-B1B9-7DC34368F80C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ActiveMq", "src\Testcontainers.ActiveMq\Testcontainers.ActiveMq.csproj", "{5365F780-0E6C-41F0-B1B9-7DC34368F80C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ArangoDb", "src\Testcontainers.ArangoDb\Testcontainers.ArangoDb.csproj", "{AB9C1563-07C7-4685-BACD-BB1FF64B3611}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ArangoDb", "src\Testcontainers.ArangoDb\Testcontainers.ArangoDb.csproj", "{AB9C1563-07C7-4685-BACD-BB1FF64B3611}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Azurite", "src\Testcontainers.Azurite\Testcontainers.Azurite.csproj", "{3F2E254F-C203-43FD-A078-DC3E2CBC0F9F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Azurite", "src\Testcontainers.Azurite\Testcontainers.Azurite.csproj", "{3F2E254F-C203-43FD-A078-DC3E2CBC0F9F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.BigQuery", "src\Testcontainers.BigQuery\Testcontainers.BigQuery.csproj", "{A9FF9C7F-BBA0-4B44-90B7-48A60F9E00F3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.BigQuery", "src\Testcontainers.BigQuery\Testcontainers.BigQuery.csproj", "{A9FF9C7F-BBA0-4B44-90B7-48A60F9E00F3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Bigtable", "src\Testcontainers.Bigtable\Testcontainers.Bigtable.csproj", "{302EC1E0-AE75-4E99-A6BF-524F35338BC8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Bigtable", "src\Testcontainers.Bigtable\Testcontainers.Bigtable.csproj", "{302EC1E0-AE75-4E99-A6BF-524F35338BC8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ClickHouse", "src\Testcontainers.ClickHouse\Testcontainers.ClickHouse.csproj", "{B061A78E-536E-4CA1-8401-234D5FBFBAB7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ClickHouse", "src\Testcontainers.ClickHouse\Testcontainers.ClickHouse.csproj", "{B061A78E-536E-4CA1-8401-234D5FBFBAB7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CockroachDb", "src\Testcontainers.CockroachDb\Testcontainers.CockroachDb.csproj", "{8D9871C6-5A39-4F0B-A15A-E87D34F3EA73}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CockroachDb", "src\Testcontainers.CockroachDb\Testcontainers.CockroachDb.csproj", "{8D9871C6-5A39-4F0B-A15A-E87D34F3EA73}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Consul", "src\Testcontainers.Consul\Testcontainers.Consul.csproj", "{51ED33B9-B688-401E-85F2-329D3C935BD1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Consul", "src\Testcontainers.Consul\Testcontainers.Consul.csproj", "{51ED33B9-B688-401E-85F2-329D3C935BD1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CosmosDb", "src\Testcontainers.CosmosDb\Testcontainers.CosmosDb.csproj", "{A724806F-8C94-4438-8011-04A9A1575318}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CosmosDb", "src\Testcontainers.CosmosDb\Testcontainers.CosmosDb.csproj", "{A724806F-8C94-4438-8011-04A9A1575318}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Couchbase", "src\Testcontainers.Couchbase\Testcontainers.Couchbase.csproj", "{58E94721-2681-4D82-8D94-0B2F9DB0D575}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Couchbase", "src\Testcontainers.Couchbase\Testcontainers.Couchbase.csproj", "{58E94721-2681-4D82-8D94-0B2F9DB0D575}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CouchDb", "src\Testcontainers.CouchDb\Testcontainers.CouchDb.csproj", "{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CouchDb", "src\Testcontainers.CouchDb\Testcontainers.CouchDb.csproj", "{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Db2", "src\Testcontainers.Db2\Testcontainers.Db2.csproj", "{ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Db2", "src\Testcontainers.Db2\Testcontainers.Db2.csproj", "{ED3C611F-DFE2-4AB7-A323-B500E95B4FF9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.DynamoDb", "src\Testcontainers.DynamoDb\Testcontainers.DynamoDb.csproj", "{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb", "src\Testcontainers.DynamoDb\Testcontainers.DynamoDb.csproj", "{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.EventStoreDb", "src\Testcontainers.EventStoreDb\Testcontainers.EventStoreDb.csproj", "{84D707E0-C9FA-4327-85DC-0AFEBEA73572}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb", "src\Testcontainers.EventStoreDb\Testcontainers.EventStoreDb.csproj", "{84D707E0-C9FA-4327-85DC-0AFEBEA73572}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FakeGcsServer", "src\Testcontainers.FakeGcsServer\Testcontainers.FakeGcsServer.csproj", "{FF86B509-2F9E-4269-ABC2-912B3339DE29}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FakeGcsServer", "src\Testcontainers.FakeGcsServer\Testcontainers.FakeGcsServer.csproj", "{FF86B509-2F9E-4269-ABC2-912B3339DE29}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FirebirdSql", "src\Testcontainers.FirebirdSql\Testcontainers.FirebirdSql.csproj", "{31BAF2C4-0608-4C0F-845A-14FE7C0A1670}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FirebirdSql", "src\Testcontainers.FirebirdSql\Testcontainers.FirebirdSql.csproj", "{31BAF2C4-0608-4C0F-845A-14FE7C0A1670}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Firestore", "src\Testcontainers.Firestore\Testcontainers.Firestore.csproj", "{B3CC460D-0DFD-48A8-9502-54E9828B7B05}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Firestore", "src\Testcontainers.Firestore\Testcontainers.Firestore.csproj", "{B3CC460D-0DFD-48A8-9502-54E9828B7B05}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.JanusGraph", "src\Testcontainers.JanusGraph\Testcontainers.JanusGraph.csproj", "{C5AF86A8-2F11-41B6-BB01-325AD9016B94}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.JanusGraph", "src\Testcontainers.JanusGraph\Testcontainers.JanusGraph.csproj", "{C5AF86A8-2F11-41B6-BB01-325AD9016B94}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.K3s", "src\Testcontainers.K3s\Testcontainers.K3s.csproj", "{111B840F-9DB0-4166-83E6-0580FD418F07}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.K3s", "src\Testcontainers.K3s\Testcontainers.K3s.csproj", "{111B840F-9DB0-4166-83E6-0580FD418F07}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kafka", "src\Testcontainers.Kafka\Testcontainers.Kafka.csproj", "{E93E40CE-59AA-4561-9B4C-E7B0A686326E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kafka", "src\Testcontainers.Kafka\Testcontainers.Kafka.csproj", "{E93E40CE-59AA-4561-9B4C-E7B0A686326E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Keycloak", "src\Testcontainers.Keycloak\Testcontainers.Keycloak.csproj", "{AA8834A3-82A7-4E83-8E4C-88D37F74056A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Keycloak", "src\Testcontainers.Keycloak\Testcontainers.Keycloak.csproj", "{AA8834A3-82A7-4E83-8E4C-88D37F74056A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kusto", "src\Testcontainers.Kusto\Testcontainers.Kusto.csproj", "{FCF59758-2403-4EC9-9EAE-4EC69A3F27AF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kusto", "src\Testcontainers.Kusto\Testcontainers.Kusto.csproj", "{FCF59758-2403-4EC9-9EAE-4EC69A3F27AF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.LocalStack", "src\Testcontainers.LocalStack\Testcontainers.LocalStack.csproj", "{3792268A-EF08-4569-8118-991E08FD61C4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.LocalStack", "src\Testcontainers.LocalStack\Testcontainers.LocalStack.csproj", "{3792268A-EF08-4569-8118-991E08FD61C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MariaDb", "src\Testcontainers.MariaDb\Testcontainers.MariaDb.csproj", "{4B204EB3-C478-422E-9B6F-62DF3871291A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MariaDb", "src\Testcontainers.MariaDb\Testcontainers.MariaDb.csproj", "{4B204EB3-C478-422E-9B6F-62DF3871291A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Milvus", "src\Testcontainers.Milvus\Testcontainers.Milvus.csproj", "{B024E315-831F-429D-92AA-44B839AC10F4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Milvus", "src\Testcontainers.Milvus\Testcontainers.Milvus.csproj", "{B024E315-831F-429D-92AA-44B839AC10F4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Minio", "src\Testcontainers.Minio\Testcontainers.Minio.csproj", "{1266E1E6-5CEF-4161-8B45-83282455746E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Minio", "src\Testcontainers.Minio\Testcontainers.Minio.csproj", "{1266E1E6-5CEF-4161-8B45-83282455746E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MongoDb", "src\Testcontainers.MongoDb\Testcontainers.MongoDb.csproj", "{2613F146-6C66-4059-9D37-D48BA6B61515}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MongoDb", "src\Testcontainers.MongoDb\Testcontainers.MongoDb.csproj", "{2613F146-6C66-4059-9D37-D48BA6B61515}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MsSql", "src\Testcontainers.MsSql\Testcontainers.MsSql.csproj", "{121FB123-40D9-44D4-9AB7-AD57ED34F466}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MsSql", "src\Testcontainers.MsSql\Testcontainers.MsSql.csproj", "{121FB123-40D9-44D4-9AB7-AD57ED34F466}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MySql", "src\Testcontainers.MySql\Testcontainers.MySql.csproj", "{9FDCFAEA-AE42-4C69-89EF-F1FF75E88CCC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MySql", "src\Testcontainers.MySql\Testcontainers.MySql.csproj", "{9FDCFAEA-AE42-4C69-89EF-F1FF75E88CCC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Nats", "src\Testcontainers.Nats\Testcontainers.Nats.csproj", "{BF37BEA1-0816-4326-B1E0-E82290F8FCE0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Nats", "src\Testcontainers.Nats\Testcontainers.Nats.csproj", "{BF37BEA1-0816-4326-B1E0-E82290F8FCE0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j", "src\Testcontainers.Neo4j\Testcontainers.Neo4j.csproj", "{ADC2372B-6FE0-421D-8277-BB628E8EFC22}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Neo4j", "src\Testcontainers.Neo4j\Testcontainers.Neo4j.csproj", "{ADC2372B-6FE0-421D-8277-BB628E8EFC22}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle", "src\Testcontainers.Oracle\Testcontainers.Oracle.csproj", "{596EAFC1-0496-495C-B382-D57415FA456A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Oracle", "src\Testcontainers.Oracle\Testcontainers.Oracle.csproj", "{596EAFC1-0496-495C-B382-D57415FA456A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{B2608563-8EE4-49AA-A9A0-B1614486AEEF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Papercut", "src\Testcontainers.Papercut\Testcontainers.Papercut.csproj", "{B2608563-8EE4-49AA-A9A0-B1614486AEEF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PostgreSql", "src\Testcontainers.PostgreSql\Testcontainers.PostgreSql.csproj", "{8AB91636-9055-4900-A72A-7CFFACDFDBF0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PubSub", "src\Testcontainers.PubSub\Testcontainers.PubSub.csproj", "{E6642255-667D-476B-B584-089AA5E6C0B1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PubSub", "src\Testcontainers.PubSub\Testcontainers.PubSub.csproj", "{E6642255-667D-476B-B584-089AA5E6C0B1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Pulsar", "src\Testcontainers.Pulsar\Testcontainers.Pulsar.csproj", "{27D46863-65B9-4934-B3C8-2383B217A477}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Pulsar", "src\Testcontainers.Pulsar\Testcontainers.Pulsar.csproj", "{27D46863-65B9-4934-B3C8-2383B217A477}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RabbitMq", "src\Testcontainers.RabbitMq\Testcontainers.RabbitMq.csproj", "{A6D480BC-FDE8-4B92-A2A6-FF16BEE486AE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RabbitMq", "src\Testcontainers.RabbitMq\Testcontainers.RabbitMq.csproj", "{A6D480BC-FDE8-4B92-A2A6-FF16BEE486AE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RavenDb", "src\Testcontainers.RavenDb\Testcontainers.RavenDb.csproj", "{F6394475-D6F1-46E2-81BF-4BA78A40B878}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RavenDb", "src\Testcontainers.RavenDb\Testcontainers.RavenDb.csproj", "{F6394475-D6F1-46E2-81BF-4BA78A40B878}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redis", "src\Testcontainers.Redis\Testcontainers.Redis.csproj", "{BFDA179A-40EB-4CEB-B8E9-0DF32C65E2C5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redis", "src\Testcontainers.Redis\Testcontainers.Redis.csproj", "{BFDA179A-40EB-4CEB-B8E9-0DF32C65E2C5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda", "src\Testcontainers.Redpanda\Testcontainers.Redpanda.csproj", "{45D6F69C-4D87-4130-AA90-0DB2F7460DAE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redpanda", "src\Testcontainers.Redpanda\Testcontainers.Redpanda.csproj", "{45D6F69C-4D87-4130-AA90-0DB2F7460DAE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ServiceBus", "src\Testcontainers.ServiceBus\Testcontainers.ServiceBus.csproj", "{2E39E532-B81E-4B48-A004-FAE18EDF9E79}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ServiceBus", "src\Testcontainers.ServiceBus\Testcontainers.ServiceBus.csproj", "{2E39E532-B81E-4B48-A004-FAE18EDF9E79}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver", "src\Testcontainers.WebDriver\Testcontainers.WebDriver.csproj", "{64A87DE5-29B0-4A54-9E74-560484D8C7C0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Xunit", "src\Testcontainers.Xunit\Testcontainers.Xunit.csproj", "{380BB29B-F556-404D-B13B-CA250599C565}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit", "src\Testcontainers.Xunit\Testcontainers.Xunit.csproj", "{380BB29B-F556-404D-B13B-CA250599C565}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.XunitV3", "src\Testcontainers.XunitV3\Testcontainers.XunitV3.csproj", "{84911C93-C2A9-46E9-AE5E-D567306589E5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.XunitV3", "src\Testcontainers.XunitV3\Testcontainers.XunitV3.csproj", "{84911C93-C2A9-46E9-AE5E-D567306589E5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers", "src\Testcontainers\Testcontainers.csproj", "{EC76857B-A3B8-4B7A-A1B0-8D867A4D1733}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ActiveMq.Tests", "tests\Testcontainers.ActiveMq.Tests\Testcontainers.ActiveMq.Tests.csproj", "{AB93C67F-0A53-4525-AE6C-29B065820ABE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ActiveMq.Tests", "tests\Testcontainers.ActiveMq.Tests\Testcontainers.ActiveMq.Tests.csproj", "{AB93C67F-0A53-4525-AE6C-29B065820ABE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ArangoDb.Tests", "tests\Testcontainers.ArangoDb.Tests\Testcontainers.ArangoDb.Tests.csproj", "{8E1E0A6D-EEBB-4455-B8E8-A55AF9B2062C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ArangoDb.Tests", "tests\Testcontainers.ArangoDb.Tests\Testcontainers.ArangoDb.Tests.csproj", "{8E1E0A6D-EEBB-4455-B8E8-A55AF9B2062C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Azurite.Tests", "tests\Testcontainers.Azurite.Tests\Testcontainers.Azurite.Tests.csproj", "{B272FDDE-5E01-425D-B9E1-10FF883DDAAA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Azurite.Tests", "tests\Testcontainers.Azurite.Tests\Testcontainers.Azurite.Tests.csproj", "{B272FDDE-5E01-425D-B9E1-10FF883DDAAA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.BigQuery.Tests", "tests\Testcontainers.BigQuery.Tests\Testcontainers.BigQuery.Tests.csproj", "{03E60673-078A-4508-99AD-8537CE6F78F1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.BigQuery.Tests", "tests\Testcontainers.BigQuery.Tests\Testcontainers.BigQuery.Tests.csproj", "{03E60673-078A-4508-99AD-8537CE6F78F1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Bigtable.Tests", "tests\Testcontainers.Bigtable.Tests\Testcontainers.Bigtable.Tests.csproj", "{2E7B92E3-8526-4706-90F3-00F0F5C47C37}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Bigtable.Tests", "tests\Testcontainers.Bigtable.Tests\Testcontainers.Bigtable.Tests.csproj", "{2E7B92E3-8526-4706-90F3-00F0F5C47C37}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ClickHouse.Tests", "tests\Testcontainers.ClickHouse.Tests\Testcontainers.ClickHouse.Tests.csproj", "{9D0A0B32-4921-400C-99CB-8650677E3E44}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ClickHouse.Tests", "tests\Testcontainers.ClickHouse.Tests\Testcontainers.ClickHouse.Tests.csproj", "{9D0A0B32-4921-400C-99CB-8650677E3E44}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CockroachDb.Tests", "tests\Testcontainers.CockroachDb.Tests\Testcontainers.CockroachDb.Tests.csproj", "{685E6D9A-B05E-41D9-A08E-5F3CA7733F7D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CockroachDb.Tests", "tests\Testcontainers.CockroachDb.Tests\Testcontainers.CockroachDb.Tests.csproj", "{685E6D9A-B05E-41D9-A08E-5F3CA7733F7D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Commons", "tests\Testcontainers.Commons\Testcontainers.Commons.csproj", "{2478673C-B063-469D-ABD1-0C3E0A25541B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Commons", "tests\Testcontainers.Commons\Testcontainers.Commons.csproj", "{2478673C-B063-469D-ABD1-0C3E0A25541B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Consul.Tests", "tests\Testcontainers.Consul.Tests\Testcontainers.Consul.Tests.csproj", "{91B23679-A2A5-4132-8AFA-740CE40A88B6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Consul.Tests", "tests\Testcontainers.Consul.Tests\Testcontainers.Consul.Tests.csproj", "{91B23679-A2A5-4132-8AFA-740CE40A88B6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CosmosDb.Tests", "tests\Testcontainers.CosmosDb.Tests\Testcontainers.CosmosDb.Tests.csproj", "{BD445A54-F411-4758-955E-397A1E98680C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CosmosDb.Tests", "tests\Testcontainers.CosmosDb.Tests\Testcontainers.CosmosDb.Tests.csproj", "{BD445A54-F411-4758-955E-397A1E98680C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Couchbase.Tests", "tests\Testcontainers.Couchbase.Tests\Testcontainers.Couchbase.Tests.csproj", "{809322BA-D690-4F2B-B884-23F895663963}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Couchbase.Tests", "tests\Testcontainers.Couchbase.Tests\Testcontainers.Couchbase.Tests.csproj", "{809322BA-D690-4F2B-B884-23F895663963}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.CouchDb.Tests", "tests\Testcontainers.CouchDb.Tests\Testcontainers.CouchDb.Tests.csproj", "{E4520FB1-4466-4DCA-AD08-4075102C68D3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.CouchDb.Tests", "tests\Testcontainers.CouchDb.Tests\Testcontainers.CouchDb.Tests.csproj", "{E4520FB1-4466-4DCA-AD08-4075102C68D3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Databases.Tests", "tests\Testcontainers.Databases.Tests\Testcontainers.Databases.Tests.csproj", "{DA54916E-1128-4200-B6AE-9F5BF02D832D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Databases.Tests", "tests\Testcontainers.Databases.Tests\Testcontainers.Databases.Tests.csproj", "{DA54916E-1128-4200-B6AE-9F5BF02D832D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Db2.Tests", "tests\Testcontainers.Db2.Tests\Testcontainers.Db2.Tests.csproj", "{AF9853AB-86E7-49DE-8DF8-454838E90D6F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Db2.Tests", "tests\Testcontainers.Db2.Tests\Testcontainers.Db2.Tests.csproj", "{AF9853AB-86E7-49DE-8DF8-454838E90D6F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.DynamoDb.Tests", "tests\Testcontainers.DynamoDb.Tests\Testcontainers.DynamoDb.Tests.csproj", "{101515E6-74C1-40F9-85C8-871F742A378D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb.Tests", "tests\Testcontainers.DynamoDb.Tests\Testcontainers.DynamoDb.Tests.csproj", "{101515E6-74C1-40F9-85C8-871F742A378D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.EventStoreDb.Tests", "tests\Testcontainers.EventStoreDb.Tests\Testcontainers.EventStoreDb.Tests.csproj", "{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb.Tests", "tests\Testcontainers.EventStoreDb.Tests\Testcontainers.EventStoreDb.Tests.csproj", "{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FakeGcsServer.Tests", "tests\Testcontainers.FakeGcsServer.Tests\Testcontainers.FakeGcsServer.Tests.csproj", "{9F27AA1B-C25D-400C-BCB0-6B0BF1A1DCEA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FakeGcsServer.Tests", "tests\Testcontainers.FakeGcsServer.Tests\Testcontainers.FakeGcsServer.Tests.csproj", "{9F27AA1B-C25D-400C-BCB0-6B0BF1A1DCEA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.FirebirdSql.Tests", "tests\Testcontainers.FirebirdSql.Tests\Testcontainers.FirebirdSql.Tests.csproj", "{E39095AC-9B34-4178-A486-04C902B6FD33}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FirebirdSql.Tests", "tests\Testcontainers.FirebirdSql.Tests\Testcontainers.FirebirdSql.Tests.csproj", "{E39095AC-9B34-4178-A486-04C902B6FD33}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Firestore.Tests", "tests\Testcontainers.Firestore.Tests\Testcontainers.Firestore.Tests.csproj", "{2F0D7CD6-7EA9-46FC-B8F2-25D55699525F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Firestore.Tests", "tests\Testcontainers.Firestore.Tests\Testcontainers.Firestore.Tests.csproj", "{2F0D7CD6-7EA9-46FC-B8F2-25D55699525F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.InfluxDb.Tests", "tests\Testcontainers.InfluxDb.Tests\Testcontainers.InfluxDb.Tests.csproj", "{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb.Tests", "tests\Testcontainers.InfluxDb.Tests\Testcontainers.InfluxDb.Tests.csproj", "{B45B0EF2-5852-4ED3-904A-8FC62A3253D7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.JanusGraph.Tests", "tests\Testcontainers.JanusGraph.Tests\Testcontainers.JanusGraph.Tests.csproj", "{BEFC4109-4511-4FBD-AC4F-3D3B388B8CAD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.JanusGraph.Tests", "tests\Testcontainers.JanusGraph.Tests\Testcontainers.JanusGraph.Tests.csproj", "{BEFC4109-4511-4FBD-AC4F-3D3B388B8CAD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.K3s.Tests", "tests\Testcontainers.K3s.Tests\Testcontainers.K3s.Tests.csproj", "{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.K3s.Tests", "tests\Testcontainers.K3s.Tests\Testcontainers.K3s.Tests.csproj", "{F0F40AE2-70FF-4191-ADDA-26A19E0D1A0F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kafka.Tests", "tests\Testcontainers.Kafka.Tests\Testcontainers.Kafka.Tests.csproj", "{6F2AEE03-629A-4B49-BD5B-25CA3C61FFB7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kafka.Tests", "tests\Testcontainers.Kafka.Tests\Testcontainers.Kafka.Tests.csproj", "{6F2AEE03-629A-4B49-BD5B-25CA3C61FFB7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Keycloak.Tests", "tests\Testcontainers.Keycloak.Tests\Testcontainers.Keycloak.Tests.csproj", "{4827D606-89D5-4E00-8341-47A6E95817BA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Keycloak.Tests", "tests\Testcontainers.Keycloak.Tests\Testcontainers.Keycloak.Tests.csproj", "{4827D606-89D5-4E00-8341-47A6E95817BA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Kusto.Tests", "tests\Testcontainers.Kusto.Tests\Testcontainers.Kusto.Tests.csproj", "{FA59D75A-8D3A-412C-92E6-4A56033162DD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Kusto.Tests", "tests\Testcontainers.Kusto.Tests\Testcontainers.Kusto.Tests.csproj", "{FA59D75A-8D3A-412C-92E6-4A56033162DD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.LocalStack.Tests", "tests\Testcontainers.LocalStack.Tests\Testcontainers.LocalStack.Tests.csproj", "{728CBE16-1D52-4F84-AF01-7229E6013512}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.LocalStack.Tests", "tests\Testcontainers.LocalStack.Tests\Testcontainers.LocalStack.Tests.csproj", "{728CBE16-1D52-4F84-AF01-7229E6013512}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MariaDb.Tests", "tests\Testcontainers.MariaDb.Tests\Testcontainers.MariaDb.Tests.csproj", "{7F0AE083-9DB8-4BD4-91F7-C199DCC7301D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MariaDb.Tests", "tests\Testcontainers.MariaDb.Tests\Testcontainers.MariaDb.Tests.csproj", "{7F0AE083-9DB8-4BD4-91F7-C199DCC7301D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Milvus.Tests", "tests\Testcontainers.Milvus.Tests\Testcontainers.Milvus.Tests.csproj", "{5247DF94-32F3-4ED6-AE71-6AB4F4078E6D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Milvus.Tests", "tests\Testcontainers.Milvus.Tests\Testcontainers.Milvus.Tests.csproj", "{5247DF94-32F3-4ED6-AE71-6AB4F4078E6D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Minio.Tests", "tests\Testcontainers.Minio.Tests\Testcontainers.Minio.Tests.csproj", "{5DB1F35F-B714-4B62-84BE-16A33084D3E1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Minio.Tests", "tests\Testcontainers.Minio.Tests\Testcontainers.Minio.Tests.csproj", "{5DB1F35F-B714-4B62-84BE-16A33084D3E1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MongoDb.Tests", "tests\Testcontainers.MongoDb.Tests\Testcontainers.MongoDb.Tests.csproj", "{82A7E7B8-3187-4CAE-845B-0BF43409B38A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MongoDb.Tests", "tests\Testcontainers.MongoDb.Tests\Testcontainers.MongoDb.Tests.csproj", "{82A7E7B8-3187-4CAE-845B-0BF43409B38A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MsSql.Tests", "tests\Testcontainers.MsSql.Tests\Testcontainers.MsSql.Tests.csproj", "{25DBED78-99F4-433F-BBF5-1B4E9DEAE437}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MsSql.Tests", "tests\Testcontainers.MsSql.Tests\Testcontainers.MsSql.Tests.csproj", "{25DBED78-99F4-433F-BBF5-1B4E9DEAE437}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.MySql.Tests", "tests\Testcontainers.MySql.Tests\Testcontainers.MySql.Tests.csproj", "{E42DA1CE-698F-4E45-8D1F-5D5895893840}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.MySql.Tests", "tests\Testcontainers.MySql.Tests\Testcontainers.MySql.Tests.csproj", "{E42DA1CE-698F-4E45-8D1F-5D5895893840}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Nats.Tests", "tests\Testcontainers.Nats.Tests\Testcontainers.Nats.Tests.csproj", "{87A3F137-6DC3-4CE5-91E6-01797D076086}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Nats.Tests", "tests\Testcontainers.Nats.Tests\Testcontainers.Nats.Tests.csproj", "{87A3F137-6DC3-4CE5-91E6-01797D076086}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Neo4j.Tests", "tests\Testcontainers.Neo4j.Tests\Testcontainers.Neo4j.Tests.csproj", "{D3F63405-C0FA-4F83-8B79-E30BFF5FF5BF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Neo4j.Tests", "tests\Testcontainers.Neo4j.Tests\Testcontainers.Neo4j.Tests.csproj", "{D3F63405-C0FA-4F83-8B79-E30BFF5FF5BF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Oracle.Tests", "tests\Testcontainers.Oracle.Tests\Testcontainers.Oracle.Tests.csproj", "{4AC1088B-9965-4497-AC8E-570F1AD5631F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Oracle.Tests", "tests\Testcontainers.Oracle.Tests\Testcontainers.Oracle.Tests.csproj", "{4AC1088B-9965-4497-AC8E-570F1AD5631F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{F03FA970-BE2B-4AE2-96FE-7E1F805CEA20}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Papercut.Tests", "tests\Testcontainers.Papercut.Tests\Testcontainers.Papercut.Tests.csproj", "{F03FA970-BE2B-4AE2-96FE-7E1F805CEA20}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Platform.Linux.Tests", "tests\Testcontainers.Platform.Linux.Tests\Testcontainers.Platform.Linux.Tests.csproj", "{DA1D7ADE-452C-4369-83CC-56289176EACD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Platform.Windows.Tests", "tests\Testcontainers.Platform.Windows.Tests\Testcontainers.Platform.Windows.Tests.csproj", "{3E55CBE8-AFE8-426D-9470-49D63CD1051C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Platform.Windows.Tests", "tests\Testcontainers.Platform.Windows.Tests\Testcontainers.Platform.Windows.Tests.csproj", "{3E55CBE8-AFE8-426D-9470-49D63CD1051C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PostgreSql.Tests", "tests\Testcontainers.PostgreSql.Tests\Testcontainers.PostgreSql.Tests.csproj", "{56D0DCA5-567F-4B3B-8B79-CB108F8EB8A6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PostgreSql.Tests", "tests\Testcontainers.PostgreSql.Tests\Testcontainers.PostgreSql.Tests.csproj", "{56D0DCA5-567F-4B3B-8B79-CB108F8EB8A6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.PubSub.Tests", "tests\Testcontainers.PubSub.Tests\Testcontainers.PubSub.Tests.csproj", "{0F86BCE8-62E1-4BFC-AA84-63C7514C90AC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.PubSub.Tests", "tests\Testcontainers.PubSub.Tests\Testcontainers.PubSub.Tests.csproj", "{0F86BCE8-62E1-4BFC-AA84-63C7514C90AC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Pulsar.Tests", "tests\Testcontainers.Pulsar.Tests\Testcontainers.Pulsar.Tests.csproj", "{D05FCB31-793E-43E0-BD6C-077013AE9113}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Pulsar.Tests", "tests\Testcontainers.Pulsar.Tests\Testcontainers.Pulsar.Tests.csproj", "{D05FCB31-793E-43E0-BD6C-077013AE9113}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RabbitMq.Tests", "tests\Testcontainers.RabbitMq.Tests\Testcontainers.RabbitMq.Tests.csproj", "{19564567-1736-4626-B406-17E4E02F18B2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RabbitMq.Tests", "tests\Testcontainers.RabbitMq.Tests\Testcontainers.RabbitMq.Tests.csproj", "{19564567-1736-4626-B406-17E4E02F18B2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.RavenDb.Tests", "tests\Testcontainers.RavenDb.Tests\Testcontainers.RavenDb.Tests.csproj", "{D53726B6-5447-47E6-B881-A44EFF6E5534}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.RavenDb.Tests", "tests\Testcontainers.RavenDb.Tests\Testcontainers.RavenDb.Tests.csproj", "{D53726B6-5447-47E6-B881-A44EFF6E5534}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redis.Tests", "tests\Testcontainers.Redis.Tests\Testcontainers.Redis.Tests.csproj", "{31EE94A0-E721-4073-B6F1-DD912D004DEF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redis.Tests", "tests\Testcontainers.Redis.Tests\Testcontainers.Redis.Tests.csproj", "{31EE94A0-E721-4073-B6F1-DD912D004DEF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Redpanda.Tests", "tests\Testcontainers.Redpanda.Tests\Testcontainers.Redpanda.Tests.csproj", "{867BD04E-4670-4FBA-98D5-9F83220E6DFB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Redpanda.Tests", "tests\Testcontainers.Redpanda.Tests\Testcontainers.Redpanda.Tests.csproj", "{867BD04E-4670-4FBA-98D5-9F83220E6DFB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ResourceReaper.Tests", "tests\Testcontainers.ResourceReaper.Tests\Testcontainers.ResourceReaper.Tests.csproj", "{9E8E6AA5-65D1-498F-BEAB-BA34723A0050}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ResourceReaper.Tests", "tests\Testcontainers.ResourceReaper.Tests\Testcontainers.ResourceReaper.Tests.csproj", "{9E8E6AA5-65D1-498F-BEAB-BA34723A0050}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.ServiceBus.Tests", "tests\Testcontainers.ServiceBus.Tests\Testcontainers.ServiceBus.Tests.csproj", "{232DD918-46ED-4BA8-B383-1A9146D83064}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ServiceBus.Tests", "tests\Testcontainers.ServiceBus.Tests\Testcontainers.ServiceBus.Tests.csproj", "{232DD918-46ED-4BA8-B383-1A9146D83064}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Tests", "tests\Testcontainers.Tests\Testcontainers.Tests.csproj", "{27CDB869-A150-4593-958F-6F26E5391E7C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver.Tests", "tests\Testcontainers.WebDriver.Tests\Testcontainers.WebDriver.Tests.csproj", "{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/tests/Testcontainers.Db2.Tests/linux.runsettings b/tests/Testcontainers.Db2.Tests/linux.runsettings index 71fa659a1..a6f6417c0 100644 --- a/tests/Testcontainers.Db2.Tests/linux.runsettings +++ b/tests/Testcontainers.Db2.Tests/linux.runsettings @@ -2,9 +2,9 @@ - Filled by msbuild - Filled by msbuild - Filled by msbuild + Set by MSBuild + Set by MSBuild + Set by MSBuild \ No newline at end of file From 505eeb744c9481d274ae4291ee40726544167c9a Mon Sep 17 00:00:00 2001 From: kevin0x90 Date: Mon, 10 Feb 2025 20:54:28 +0100 Subject: [PATCH 31/33] Implement code review feedback --- src/Testcontainers.Db2/Db2Builder.cs | 49 ++++--------------- src/Testcontainers.Db2/Db2Configuration.cs | 41 +++++----------- .../Db2ContainerTest.cs | 10 +++- 3 files changed, 31 insertions(+), 69 deletions(-) diff --git a/src/Testcontainers.Db2/Db2Builder.cs b/src/Testcontainers.Db2/Db2Builder.cs index 322c30c53..e8554fbdf 100644 --- a/src/Testcontainers.Db2/Db2Builder.cs +++ b/src/Testcontainers.Db2/Db2Builder.cs @@ -4,7 +4,7 @@ namespace Testcontainers.Db2; [PublicAPI] public sealed class Db2Builder : ContainerBuilder { - public const string Db2Image = "icr.io/db2_community/db2:latest"; + public const string Db2Image = "icr.io/db2_community/db2:12.1.0.0"; public const ushort Db2Port = 50000; @@ -73,28 +73,6 @@ public Db2Builder WithPassword(string password) .WithEnvironment("DB2INST1_PASSWORD", password); } - /// - /// Sets the Db2 archive logs. - /// - /// The Db2 archive logs setting. - /// A configured instance of . - public Db2Builder WithArchiveLogs(bool archiveLogs) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(archiveLogs: archiveLogs)) - .WithEnvironment("ARCHIVE_LOGS", archiveLogs.ToString()); - } - - /// - /// Sets the Db2 autoconfig setting. - /// - /// The Db2 autoconfig setting. - /// A configured instance of . - public Db2Builder WithAutoconfig(bool autoConfig) - { - return Merge(DockerResourceConfiguration, new Db2Configuration(autoConfig: autoConfig)) - .WithEnvironment("AUTOCONFIG", autoConfig.ToString()); - } - /// /// Accepts the Db2 license agreement. /// @@ -111,7 +89,7 @@ public Db2Builder WithLicenseAgreement() /// A configured instance of . public Db2Builder WithInMemoryDatabase() { - return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultInMemoryDatabasePath)) + return Merge(DockerResourceConfiguration, new Db2Configuration(inMemoryDatabasePath: DefaultInMemoryDatabasePath)) .WithTmpfsMount(DefaultInMemoryDatabasePath); } @@ -119,21 +97,10 @@ public Db2Builder WithInMemoryDatabase() public override Db2Container Build() { Validate(); - - // By default, the base builder waits until the container is running. However, for Db2, a more advanced waiting strategy is necessary - // If the user does not provide a custom waiting strategy, append the default Db2 waiting strategy. - var db2Builder = DockerResourceConfiguration.WaitStrategies.Count() > 1 - ? this - : WithWaitStrategy(Wait.ForUnixContainer() - .UntilMessageIsLogged("All databases are now active") - .UntilMessageIsLogged("Setup has completed.") - .AddCustomWaitStrategy(new WaitUntil(DockerResourceConfiguration)) - ); - - return new Db2Container(db2Builder.DockerResourceConfiguration); + return new Db2Container(DockerResourceConfiguration); } - /// + /// protected override Db2Builder Init() => base.Init() .WithImage(Db2Image) .WithPortBinding(Db2Port, true) @@ -141,10 +108,12 @@ protected override Db2Builder Init() => base.Init() .WithUsername(DefaultUsername) .WithPassword(DefaultPassword) .WithLicenseAgreement() - .WithArchiveLogs(false) - .WithAutoconfig(false) .WithInMemoryDatabase() - .WithPrivileged(true); + .WithPrivileged(true) + .WithWaitStrategy(Wait.ForUnixContainer() + .UntilMessageIsLogged("All databases are now active") + .UntilMessageIsLogged("Setup has completed.") + .AddCustomWaitStrategy(new WaitUntil(DockerResourceConfiguration))); /// protected override void Validate() diff --git a/src/Testcontainers.Db2/Db2Configuration.cs b/src/Testcontainers.Db2/Db2Configuration.cs index e761990d0..68e642271 100644 --- a/src/Testcontainers.Db2/Db2Configuration.cs +++ b/src/Testcontainers.Db2/Db2Configuration.cs @@ -4,6 +4,11 @@ namespace Testcontainers.Db2; [PublicAPI] public sealed class Db2Configuration : ContainerConfiguration { + private readonly bool _archiveLogs; + private readonly bool _autoConfig; + private readonly string _licenseAgreement; + private readonly string _inMemoryDatabasePath; + /// /// Initializes a new instance of the class. /// @@ -26,10 +31,10 @@ public Db2Configuration( Database = database; Username = username; Password = password; - ArchiveLogs = archiveLogs; - AutoConfig = autoConfig; - LicenseAgreement = licenseAgreement; - InMemoryDatabasePath = inMemoryDatabasePath; + _archiveLogs = archiveLogs; + _autoConfig = autoConfig; + _licenseAgreement = licenseAgreement; + _inMemoryDatabasePath = inMemoryDatabasePath; } /// @@ -73,10 +78,10 @@ public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database); Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username); Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password); - ArchiveLogs = BuildConfiguration.Combine(oldValue.ArchiveLogs, newValue.ArchiveLogs); - AutoConfig = BuildConfiguration.Combine(oldValue.AutoConfig, newValue.AutoConfig); - LicenseAgreement = BuildConfiguration.Combine(oldValue.LicenseAgreement, newValue.LicenseAgreement); - InMemoryDatabasePath = BuildConfiguration.Combine(oldValue.InMemoryDatabasePath, newValue.InMemoryDatabasePath); + _archiveLogs = BuildConfiguration.Combine(oldValue._archiveLogs, newValue._archiveLogs); + _autoConfig = BuildConfiguration.Combine(oldValue._autoConfig, newValue._autoConfig); + _licenseAgreement = BuildConfiguration.Combine(oldValue._licenseAgreement, newValue._licenseAgreement); + _inMemoryDatabasePath = BuildConfiguration.Combine(oldValue._inMemoryDatabasePath, newValue._inMemoryDatabasePath); } /// @@ -93,24 +98,4 @@ public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) /// Gets the Db2 password. /// public string Password { get; } - - /// - /// Toggle for archivation of logs. - /// - public bool ArchiveLogs { get; } - - /// - /// Toggle for database autoconfiguration. - /// - public bool AutoConfig { get; } - - /// - /// License agreement value. - /// - public string LicenseAgreement { get; } - - /// - /// Path to the database files that should be mapped into memory (tmpfs). - /// - public string InMemoryDatabasePath { get; } } \ No newline at end of file diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index e5b21ef2a..2e7232abf 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -3,7 +3,15 @@ namespace Testcontainers.Db2; public sealed class Db2ContainerTest : IAsyncLifetime { // # --8<-- [start:UseDb2Container] - private readonly Db2Container _db2Container = new Db2Builder().Build(); + private readonly Db2Container _db2Container = new Db2Builder() + .WithEnvironment("TO_CREATE_SAMPLEDB", "false") + .WithEnvironment("PERSISTENT_HOME", "true") + .WithEnvironment("REPODB", "false") + .WithEnvironment("BLU", "false") + .WithEnvironment("HADR_ENABLED", "false") + .WithEnvironment("ARCHIVE_LOGS", "false") + .WithEnvironment("AUTOCONFIG", "false") + .Build(); public Task InitializeAsync() { From 75d564d8fab126a0a106af604485a2c0c4970548 Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:33:36 +0100 Subject: [PATCH 32/33] chore: Update remaining parts --- Directory.Packages.props | 4 +- Testcontainers.sln | 3 + docs/modules/db2.md | 36 +++----- src/Testcontainers.Db2/Db2Builder.cs | 82 +++++++------------ src/Testcontainers.Db2/Db2Configuration.cs | 23 +----- src/Testcontainers.Db2/Db2Container.cs | 54 ++++++------ src/Testcontainers.Db2/Usings.cs | 2 + .../Db2ContainerTest.cs | 21 +---- .../Testcontainers.Db2.Tests.csproj | 2 + 9 files changed, 88 insertions(+), 139 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d4a008830..8e9a696b3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -41,8 +41,8 @@ - - + + diff --git a/Testcontainers.sln b/Testcontainers.sln index 96b132ea7..437b58bb4 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -218,6 +218,9 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}" EndProject Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU diff --git a/docs/modules/db2.md b/docs/modules/db2.md index c8924d1c5..dbcca4aa6 100644 --- a/docs/modules/db2.md +++ b/docs/modules/db2.md @@ -1,41 +1,31 @@ # IBM DB2 -[IBM DB2](https://www.ibm.com/db2), is a relational database engine developed by IBM. The following example provides .NET developers with a starting point to use a IBM DB2 instance in the [xUnit][xunit] tests. +[IBM DB2](https://www.ibm.com/db2) is a relational database engine developed by IBM. -The following example (for windows) uses the following NuGet packages: +Add the following dependency to your project file: -```console title="Install the NuGet dependencies" +```shell title="NuGet" dotnet add package Testcontainers.Db2 -dotnet add package Net.IBM.Data.Db2 -dotnet add package xunit ``` -Please note: For linux there are currently some hurdles and the package Net.IBM.Data.Db2-lnx has to be used with the following environment variables being set: +!!! warning - - LD_LIBRARY_PATH - - PATH - - DB2_CLI_DRIVER_INSTALL_PATH + The Linux client dependency, [Net.IBM.Data.Db2-lnx](https://www.nuget.org/packages/Net.IBM.Data.Db2-lnx), requires additional configurations. We use the [Testcontainers.Db2.Tests.targets](tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets) file to configure the environment variables: `LD_LIBRARY_PATH`, `PATH`, `DB2_CLI_DRIVER_INSTALL_PATH`, at runtime. -One way to achieve this within a test project is to extend the .csproj with a task that writes a .runsettings file. An example is given below: - -=== "Example" - ```xml - --8<-- "tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj:RunSettingsGeneration" - ``` - -IDEs and editors may also require the following packages to run tests: `xunit.runner.visualstudio` and `Microsoft.NET.Test.Sdk`. - -Copy and paste the following code into a new `.cs` test file within an existing test project. +You can start an DB2 container instance from any .NET application. This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method. === "Usage Example" ```csharp --8<-- "tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs:UseDb2Container" ``` -To execute the tests, use the command `dotnet test` from a terminal. +The test example uses the following NuGet dependencies: -## A Note To Developers +=== "Package References" + ```xml + --8<-- "tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj:PackageReferences" + ``` -Once Testcontainers creates a server instance, developers may use the connection string with any of the popular data-access technologies found in the .NET Ecosystem. Some of these libraries include [Entity Framework Core](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore), [Dapper](https://www.nuget.org/packages/Dapper), and [NHibernate](https://www.nuget.org/packages/NHibernate). At which point, developers can execute database migrations and SQL scripts. +To execute the tests, use the command `dotnet test` from a terminal. -[xunit]: https://xunit.net/ +--8<-- "docs/modules/_call_out_test_projects.txt" \ No newline at end of file diff --git a/src/Testcontainers.Db2/Db2Builder.cs b/src/Testcontainers.Db2/Db2Builder.cs index e8554fbdf..3f1b9ccf1 100644 --- a/src/Testcontainers.Db2/Db2Builder.cs +++ b/src/Testcontainers.Db2/Db2Builder.cs @@ -14,9 +14,11 @@ public sealed class Db2Builder : ContainerBuilder /// Initializes a new instance of the class. @@ -40,6 +42,20 @@ private Db2Builder(Db2Configuration resourceConfiguration) /// protected override Db2Configuration DockerResourceConfiguration { get; } + /// + /// Accepts the license agreement. + /// + /// + /// When is set to true, the Db2 license is accepted. + /// + /// A boolean value indicating whether the Db2 license agreement is accepted. + /// A configured instance of . + public Db2Builder WithAcceptLicenseAgreement(bool acceptLicenseAgreement) + { + var licenseAgreement = acceptLicenseAgreement ? AcceptLicenseAgreement : DeclineLicenseAgreement; + return WithEnvironment(AcceptLicenseAgreementEnvVar, licenseAgreement); + } + /// /// Sets the Db2 database name. /// @@ -59,7 +75,8 @@ public Db2Builder WithDatabase(string database) public Db2Builder WithUsername(string username) { return Merge(DockerResourceConfiguration, new Db2Configuration(username: username)) - .WithEnvironment("DB2INSTANCE", username); + .WithEnvironment("DB2INSTANCE", username) + .WithTmpfsMount(string.Join("/", string.Empty, "home", username, "data")); } /// @@ -73,26 +90,6 @@ public Db2Builder WithPassword(string password) .WithEnvironment("DB2INST1_PASSWORD", password); } - /// - /// Accepts the Db2 license agreement. - /// - /// A configured instance of . - public Db2Builder WithLicenseAgreement() - { - return Merge(DockerResourceConfiguration, new Db2Configuration(licenseAgreement: DefaultLicenseAgreement)) - .WithEnvironment("LICENSE", DefaultLicenseAgreement); - } - - /// - /// Maps the database to memory. - /// - /// A configured instance of . - public Db2Builder WithInMemoryDatabase() - { - return Merge(DockerResourceConfiguration, new Db2Configuration(inMemoryDatabasePath: DefaultInMemoryDatabasePath)) - .WithTmpfsMount(DefaultInMemoryDatabasePath); - } - /// public override Db2Container Build() { @@ -100,26 +97,29 @@ public override Db2Container Build() return new Db2Container(DockerResourceConfiguration); } - /// + /// protected override Db2Builder Init() => base.Init() .WithImage(Db2Image) .WithPortBinding(Db2Port, true) .WithDatabase(DefaultDatabase) .WithUsername(DefaultUsername) .WithPassword(DefaultPassword) - .WithLicenseAgreement() - .WithInMemoryDatabase() .WithPrivileged(true) - .WithWaitStrategy(Wait.ForUnixContainer() - .UntilMessageIsLogged("All databases are now active") - .UntilMessageIsLogged("Setup has completed.") - .AddCustomWaitStrategy(new WaitUntil(DockerResourceConfiguration))); + .WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Setup has completed.")); /// protected override void Validate() { + const string message = "The image '{0}' requires you to accept a license agreement."; + base.Validate(); + Predicate licenseAgreementNotAccepted = value => + !value.Environments.TryGetValue(AcceptLicenseAgreementEnvVar, out var licenseAgreementValue) || !AcceptLicenseAgreement.Equals(licenseAgreementValue, StringComparison.Ordinal); + + _ = Guard.Argument(DockerResourceConfiguration, nameof(DockerResourceConfiguration.Image)) + .ThrowIf(argument => licenseAgreementNotAccepted(argument.Value), argument => throw new ArgumentException(string.Format(message, DockerResourceConfiguration.Image.FullName), argument.Name)); + _ = Guard.Argument(DockerResourceConfiguration.Username, nameof(DockerResourceConfiguration.Username)) .NotNull() .NotEmpty(); @@ -146,26 +146,4 @@ protected override Db2Builder Merge(Db2Configuration oldValue, Db2Configuration { return new Db2Builder(new Db2Configuration(oldValue, newValue)); } - - /// - private sealed class WaitUntil : IWaitUntil - { - /// - /// Initializes a new instance of the class. - /// - /// The container configuration. - public WaitUntil(Db2Configuration configuration) - { - } - - /// - public async Task UntilAsync(IContainer container) - { - var db2Container = (Db2Container)container; - - var execResult = await db2Container.ExecScriptAsync("SELECT 1 FROM SYSIBM.SYSDUMMY1").ConfigureAwait(false); - - return 0L.Equals(execResult.ExitCode); - } - } } \ No newline at end of file diff --git a/src/Testcontainers.Db2/Db2Configuration.cs b/src/Testcontainers.Db2/Db2Configuration.cs index 68e642271..97208985b 100644 --- a/src/Testcontainers.Db2/Db2Configuration.cs +++ b/src/Testcontainers.Db2/Db2Configuration.cs @@ -4,37 +4,20 @@ namespace Testcontainers.Db2; [PublicAPI] public sealed class Db2Configuration : ContainerConfiguration { - private readonly bool _archiveLogs; - private readonly bool _autoConfig; - private readonly string _licenseAgreement; - private readonly string _inMemoryDatabasePath; - /// /// Initializes a new instance of the class. /// /// The Db2 database. /// The Db2 username. /// The Db2 password. - /// The Db2 archive logs setting. - /// The Db2 auto config setting. - /// The Db2 license agreement. - /// The Db2 database path to map into memory (tmpfs). public Db2Configuration( string database = null, string username = null, - string password = null, - bool archiveLogs = false, - bool autoConfig = false, - string licenseAgreement = null, - string inMemoryDatabasePath = null) + string password = null) { Database = database; Username = username; Password = password; - _archiveLogs = archiveLogs; - _autoConfig = autoConfig; - _licenseAgreement = licenseAgreement; - _inMemoryDatabasePath = inMemoryDatabasePath; } /// @@ -78,10 +61,6 @@ public Db2Configuration(Db2Configuration oldValue, Db2Configuration newValue) Database = BuildConfiguration.Combine(oldValue.Database, newValue.Database); Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username); Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password); - _archiveLogs = BuildConfiguration.Combine(oldValue._archiveLogs, newValue._archiveLogs); - _autoConfig = BuildConfiguration.Combine(oldValue._autoConfig, newValue._autoConfig); - _licenseAgreement = BuildConfiguration.Combine(oldValue._licenseAgreement, newValue._licenseAgreement); - _inMemoryDatabasePath = BuildConfiguration.Combine(oldValue._inMemoryDatabasePath, newValue._inMemoryDatabasePath); } /// diff --git a/src/Testcontainers.Db2/Db2Container.cs b/src/Testcontainers.Db2/Db2Container.cs index 7e55509f4..a52dd5642 100644 --- a/src/Testcontainers.Db2/Db2Container.cs +++ b/src/Testcontainers.Db2/Db2Container.cs @@ -4,37 +4,45 @@ namespace Testcontainers.Db2; [PublicAPI] public sealed class Db2Container : DockerContainer, IDatabaseContainer { - private static string Db2CommandPath = "/opt/ibm/db2/*/bin/db2"; - private readonly Db2Configuration _configuration; - private const char ConnectionStringDelimiter = ';'; - public Db2Container(Db2Configuration configuration) : base(configuration) { _configuration = configuration; } - public string GetConnectionString() => new StringBuilder() - .Append("Server=").Append(Hostname).Append(':').Append(GetMappedPublicPort(Db2Builder.Db2Port).ToString()) - .Append(ConnectionStringDelimiter) - .Append("Database=").Append(_configuration.Database).Append(ConnectionStringDelimiter) - .Append("UID=").Append(_configuration.Username).Append(ConnectionStringDelimiter) - .Append("PWD=").Append(_configuration.Password).Append(ConnectionStringDelimiter) - .ToString(); + /// + /// Gets the Db2 connection string. + /// + /// The Db2 connection string. + public string GetConnectionString() + { + var properties = new Dictionary(); + properties.Add("Server", Hostname + ":" + GetMappedPublicPort(Db2Builder.Db2Port)); + properties.Add("Database", _configuration.Database); + properties.Add("UID", _configuration.Username); + properties.Add("PWD", _configuration.Password); + return string.Join(";", properties.Select(property => string.Join("=", property.Key, property.Value))); + } - public async Task ExecScriptAsync(string scriptContent, CancellationToken cancellationToken = default) + /// + /// Executes the SQL script in the Db2 container. + /// + /// The content of the SQL script to execute. + /// Cancellation token. + /// Task that completes when the SQL script has been executed. + public async Task ExecScriptAsync(string scriptContent, CancellationToken ct = default) { - string[] command = - [ - "su", "db2inst1", "-c", new StringBuilder() - .Append(Db2CommandPath).Append(" connect to ").Append(_configuration.Database) - .Append(" user ").Append(_configuration.Username).Append(" using ").Append(_configuration.Password) - .Append("; ") - .Append(Db2CommandPath).Append(' ').Append(scriptContent) - .ToString() - ]; - - return await ExecAsync(command).ConfigureAwait(false); + const string db2ShellCommandFormat = "su - {1} -c \"db2 connect to {0} && db2 -tvf '{2}'\""; + + var scriptFilePath = string.Join("/", string.Empty, "tmp", Guid.NewGuid().ToString("D"), Path.GetRandomFileName()); + + var db2ShellCommand = string.Format(db2ShellCommandFormat, _configuration.Database, _configuration.Username, scriptFilePath); + + await CopyAsync(Encoding.Default.GetBytes(scriptContent), scriptFilePath, Unix.FileMode644, ct) + .ConfigureAwait(false); + + return await ExecAsync(new [] { "/bin/sh", "-c", db2ShellCommand}, ct) + .ConfigureAwait(false); } } \ No newline at end of file diff --git a/src/Testcontainers.Db2/Usings.cs b/src/Testcontainers.Db2/Usings.cs index 7a1babb38..e2b02a51e 100644 --- a/src/Testcontainers.Db2/Usings.cs +++ b/src/Testcontainers.Db2/Usings.cs @@ -1,4 +1,6 @@ global using System; +global using System.Collections.Generic; +global using System.IO; global using System.Linq; global using System.Text; global using System.Threading; diff --git a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs index 2e7232abf..3b74470d7 100644 --- a/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs +++ b/tests/Testcontainers.Db2.Tests/Db2ContainerTest.cs @@ -3,15 +3,7 @@ namespace Testcontainers.Db2; public sealed class Db2ContainerTest : IAsyncLifetime { // # --8<-- [start:UseDb2Container] - private readonly Db2Container _db2Container = new Db2Builder() - .WithEnvironment("TO_CREATE_SAMPLEDB", "false") - .WithEnvironment("PERSISTENT_HOME", "true") - .WithEnvironment("REPODB", "false") - .WithEnvironment("BLU", "false") - .WithEnvironment("HADR_ENABLED", "false") - .WithEnvironment("ARCHIVE_LOGS", "false") - .WithEnvironment("AUTOCONFIG", "false") - .Build(); + private readonly Db2Container _db2Container = new Db2Builder().WithAcceptLicenseAgreement(true).Build(); public Task InitializeAsync() { @@ -25,7 +17,7 @@ public Task DisposeAsync() [Fact] [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] - public async Task ReadFromDb2Database() + public void ConnectionStateReturnsOpen() { // Given using DbConnection connection = new DB2Connection(_db2Container.GetConnectionString()); @@ -33,12 +25,6 @@ public async Task ReadFromDb2Database() // When connection.Open(); - using DbCommand command = connection.CreateCommand(); - command.CommandText = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; - - var actual = await command.ExecuteScalarAsync() as int?; - Assert.Equal(1, actual.GetValueOrDefault()); - // Then Assert.Equal(ConnectionState.Open, connection.State); } @@ -51,7 +37,8 @@ public async Task ExecScriptReturnsSuccessful() const string scriptContent = "SELECT 1 FROM SYSIBM.SYSDUMMY1;"; // When - var execResult = await _db2Container.ExecScriptAsync(scriptContent); + var execResult = await _db2Container.ExecScriptAsync(scriptContent) + .ConfigureAwait(true); // Then Assert.True(0L.Equals(execResult.ExitCode), execResult.Stderr); diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index 024d95cb7..4167df3b1 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -10,12 +10,14 @@ + + From 7fc391bd0350d75e8684ed8bddc33b1c195f213b Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:10:47 +0100 Subject: [PATCH 33/33] fix: Replace link to targets file --- Testcontainers.sln | 6 +++--- docs/modules/db2.md | 8 ++++---- .../Testcontainers.Db2.Tests.csproj | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Testcontainers.sln b/Testcontainers.sln index 437b58bb4..06e1381fc 100644 --- a/Testcontainers.sln +++ b/Testcontainers.sln @@ -218,13 +218,13 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}" EndProject Global - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Debug|Any CPU.Build.0 = Debug|Any CPU diff --git a/docs/modules/db2.md b/docs/modules/db2.md index dbcca4aa6..8df65e230 100644 --- a/docs/modules/db2.md +++ b/docs/modules/db2.md @@ -1,6 +1,6 @@ -# IBM DB2 +# Db2 -[IBM DB2](https://www.ibm.com/db2) is a relational database engine developed by IBM. +[Db2](https://www.ibm.com/db2) is a relational database engine developed by IBM. Add the following dependency to your project file: @@ -10,9 +10,9 @@ dotnet add package Testcontainers.Db2 !!! warning - The Linux client dependency, [Net.IBM.Data.Db2-lnx](https://www.nuget.org/packages/Net.IBM.Data.Db2-lnx), requires additional configurations. We use the [Testcontainers.Db2.Tests.targets](tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets) file to configure the environment variables: `LD_LIBRARY_PATH`, `PATH`, `DB2_CLI_DRIVER_INSTALL_PATH`, at runtime. + The Linux client dependency, [Net.IBM.Data.Db2-lnx](https://www.nuget.org/packages/Net.IBM.Data.Db2-lnx), requires additional configurations. We use the [Testcontainers.Db2.Tests.targets](https://github.com/testcontainers/testcontainers-dotnet/blob/develop/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.targets) file to configure the environment variables: `LD_LIBRARY_PATH`, `PATH`, `DB2_CLI_DRIVER_INSTALL_PATH`, at runtime. -You can start an DB2 container instance from any .NET application. This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method. +You can start an Db2 container instance from any .NET application. This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method. === "Usage Example" ```csharp diff --git a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj index 4167df3b1..58eff6fce 100644 --- a/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj +++ b/tests/Testcontainers.Db2.Tests/Testcontainers.Db2.Tests.csproj @@ -4,13 +4,13 @@ false false + -