diff --git a/packages/modules/arangodb/src/arangodb-container.test.ts b/packages/modules/arangodb/src/arangodb-container.test.ts index 2bc2a3052..ebed89c90 100755 --- a/packages/modules/arangodb/src/arangodb-container.test.ts +++ b/packages/modules/arangodb/src/arangodb-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("ArangoDB", { timeout: 180_000 }, () => { // connect { - it("should connect and return a query result", async () => { + it.concurrent("should connect and return a query result", async () => { const container = await new ArangoDBContainer(IMAGE).start(); const db = new Database({ url: container.getHttpUrl() }); diff --git a/packages/modules/azurecosmosdb/src/azure-cosmosdb-emulator-container.test.ts b/packages/modules/azurecosmosdb/src/azure-cosmosdb-emulator-container.test.ts index 4cf569cc7..1a904e8f5 100644 --- a/packages/modules/azurecosmosdb/src/azure-cosmosdb-emulator-container.test.ts +++ b/packages/modules/azurecosmosdb/src/azure-cosmosdb-emulator-container.test.ts @@ -6,13 +6,13 @@ import { AzureCosmosDbEmulatorContainer } from "./azure-cosmosdb-emulator-contai const IMAGE = getImage(__dirname); describe("AzureCosmosDbEmulatorContainer", { timeout: 180_000 }, async () => { - it("should set https protocol", async () => { + it.concurrent("should set https protocol", async () => { const container = await new AzureCosmosDbEmulatorContainer(IMAGE).withProtocol("https").start(); const connectionUri = container.getConnectionUri(); expect(connectionUri).toContain("AccountEndpoint=https://"); await container.stop(); }); - it("should set http protocol if no protocol is specified", async () => { + it.concurrent("should set http protocol if no protocol is specified", async () => { const container = await new AzureCosmosDbEmulatorContainer(IMAGE).start(); const connectionUri = container.getConnectionUri(); expect(connectionUri).toContain("AccountEndpoint=http://"); @@ -20,7 +20,7 @@ describe("AzureCosmosDbEmulatorContainer", { timeout: 180_000 }, async () => { }); // httpCreateDB { - it("should be able to create a database using http", async () => { + it.concurrent("should be able to create a database using http", async () => { const container = await new AzureCosmosDbEmulatorContainer(IMAGE).withProtocol("http").start(); const cosmosClient = new CosmosClient({ endpoint: container.getEndpoint(), @@ -41,7 +41,7 @@ describe("AzureCosmosDbEmulatorContainer", { timeout: 180_000 }, async () => { // } // httpsCreateDB { - it("should be able to create a database using https", async () => { + it.concurrent("should be able to create a database using https", async () => { const container = await new AzureCosmosDbEmulatorContainer(IMAGE).withProtocol("https").start(); const cosmosClient = new CosmosClient({ endpoint: container.getEndpoint(), @@ -65,7 +65,7 @@ describe("AzureCosmosDbEmulatorContainer", { timeout: 180_000 }, async () => { // } // createAndRead { - it("should be able to create a container and store and retrieve items", async () => { + it.concurrent("should be able to create a container and store and retrieve items", async () => { const container = await new AzureCosmosDbEmulatorContainer(IMAGE).withProtocol("http").start(); const cosmosClient = new CosmosClient({ endpoint: container.getEndpoint(), diff --git a/packages/modules/azurite/src/azurite-container.test.ts b/packages/modules/azurite/src/azurite-container.test.ts index a892df646..cb4c2d6c1 100644 --- a/packages/modules/azurite/src/azurite-container.test.ts +++ b/packages/modules/azurite/src/azurite-container.test.ts @@ -8,7 +8,7 @@ const IMAGE = getImage(__dirname); describe("Azurite", { timeout: 240_000 }, () => { // uploadAndDownloadBlob { - it("should upload and download blob with default credentials", async () => { + it.concurrent("should upload and download blob with default credentials", async () => { const container = await new AzuriteContainer(IMAGE).start(); const connectionString = container.getConnectionString(); @@ -40,7 +40,7 @@ describe("Azurite", { timeout: 240_000 }, () => { // } // sendAndReceiveQueue { - it("should add to queue with default credentials", async () => { + it.concurrent("should add to queue with default credentials", async () => { const container = await new AzuriteContainer(IMAGE).start(); const connectionString = container.getConnectionString(); @@ -64,7 +64,7 @@ describe("Azurite", { timeout: 240_000 }, () => { // } // createAndInsertOnTable { - it("should add to table with default credentials", async () => { + it.concurrent("should add to table with default credentials", async () => { const container = await new AzuriteContainer(IMAGE).start(); const connectionString = container.getConnectionString(); @@ -92,7 +92,7 @@ describe("Azurite", { timeout: 240_000 }, () => { // } // customCredentials { - it("should be able to specify accountName and accountKey", async () => { + it.concurrent("should be able to specify accountName and accountKey", async () => { const accountName = "test-account"; // Account key must be base64 encoded const accountKey = Buffer.from("test-key").toString("base64"); @@ -115,7 +115,7 @@ describe("Azurite", { timeout: 240_000 }, () => { // } // customPorts { - it("should be able to specify custom ports", async () => { + it.concurrent("should be able to specify custom ports", async () => { const blobPort = 13000; const queuePort = 14000; const tablePort = 15000; @@ -143,7 +143,7 @@ describe("Azurite", { timeout: 240_000 }, () => { // } // inMemoryPersistence { - it("should be able to use in-memory persistence", async () => { + it.concurrent("should be able to use in-memory persistence", async () => { const container = await new AzuriteContainer(IMAGE).withInMemoryPersistence().start(); const blobName = "hello.txt"; diff --git a/packages/modules/cassandra/src/cassandra-container.test.ts b/packages/modules/cassandra/src/cassandra-container.test.ts index ababeb160..282ab0085 100644 --- a/packages/modules/cassandra/src/cassandra-container.test.ts +++ b/packages/modules/cassandra/src/cassandra-container.test.ts @@ -7,7 +7,7 @@ const IMAGE = getImage(__dirname); describe("Cassandra", { timeout: 240_000 }, () => { // connectWithDefaultCredentials { - it("should connect and execute a query with default credentials", async () => { + it.concurrent("should connect and execute a query with default credentials", async () => { const container = await new CassandraContainer(IMAGE).start(); const client = new Client({ @@ -27,7 +27,7 @@ describe("Cassandra", { timeout: 240_000 }, () => { // } // connectWithCustomCredentials { - it("should connect with custom username and password", async () => { + it.concurrent("should connect with custom username and password", async () => { const username = "testUser"; const password = "testPassword"; @@ -51,7 +51,7 @@ describe("Cassandra", { timeout: 240_000 }, () => { // } // customDataSenterAndRack { - it("should set datacenter and rack", async () => { + it.concurrent("should set datacenter and rack", async () => { const customDataCenter = "customDC"; const customRack = "customRack"; const container = await new CassandraContainer(IMAGE).withDatacenter(customDataCenter).withRack(customRack).start(); @@ -72,7 +72,7 @@ describe("Cassandra", { timeout: 240_000 }, () => { // } // createAndFetchData { - it("should create keyspace, a table, insert data, and retrieve it", async () => { + it.concurrent("should create keyspace, a table, insert data, and retrieve it", async () => { const container = await new CassandraContainer(IMAGE).start(); const client = new Client({ @@ -112,7 +112,7 @@ describe("Cassandra", { timeout: 240_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new CassandraContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/chromadb/src/chromadb-container.test.ts b/packages/modules/chromadb/src/chromadb-container.test.ts index ae865b1c3..de198b640 100755 --- a/packages/modules/chromadb/src/chromadb-container.test.ts +++ b/packages/modules/chromadb/src/chromadb-container.test.ts @@ -10,7 +10,7 @@ const IMAGE = getImage(__dirname); describe("ChromaDB", { timeout: 360_000 }, () => { // startContainer { - it("should connect", async () => { + it.concurrent("should connect", async () => { const container = await new ChromaDBContainer(IMAGE).start(); const client = await connectTo(container); expect(await client.heartbeat()).toBeDefined(); @@ -31,7 +31,7 @@ describe("ChromaDB", { timeout: 360_000 }, () => { // } // createCollection { - it("should create collection and get data", async () => { + it.concurrent("should create collection and get data", async () => { const container = await new ChromaDBContainer(IMAGE).start(); const client = await connectTo(container); const collection = await client.createCollection({ name: "test", metadata: { "hnsw:space": "cosine" } }); @@ -49,7 +49,7 @@ describe("ChromaDB", { timeout: 360_000 }, () => { // } // queryCollectionWithEmbeddingFunction { - it("should create collection and query", async () => { + it.concurrent("should create collection and query", async () => { const container = await new ChromaDBContainer(IMAGE).start(); const ollama = await new GenericContainer("ollama/ollama").withExposedPorts(11434).start(); await ollama.exec(["ollama", "pull", "nomic-embed-text"]); @@ -79,7 +79,7 @@ describe("ChromaDB", { timeout: 360_000 }, () => { }); // persistentData { - it("should reconnect with volume and persistence data", async () => { + it.concurrent("should reconnect with volume and persistence data", async () => { const sourcePath = fs.mkdtempSync(path.join(os.tmpdir(), "chroma-temp")); const container = await new ChromaDBContainer(IMAGE) .withBindMounts([{ source: sourcePath, target: "/data" }]) @@ -105,7 +105,7 @@ describe("ChromaDB", { timeout: 360_000 }, () => { // } // auth { - it("should use auth", async () => { + it.concurrent("should use auth", async () => { const tenant = "test-tenant"; const key = "test-key"; const database = "test-db"; diff --git a/packages/modules/clickhouse/src/clickhouse-container.test.ts b/packages/modules/clickhouse/src/clickhouse-container.test.ts index b2773b073..cfafaa6c6 100644 --- a/packages/modules/clickhouse/src/clickhouse-container.test.ts +++ b/packages/modules/clickhouse/src/clickhouse-container.test.ts @@ -10,7 +10,7 @@ interface ClickHouseQueryResponse { describe("ClickHouseContainer", { timeout: 180_000 }, () => { // connectWithOptions { - it("should connect using the client options object", async () => { + it.concurrent("should connect using the client options object", async () => { const container = await new ClickHouseContainer(IMAGE).start(); const client = createClient(container.getClientOptions()); @@ -27,7 +27,7 @@ describe("ClickHouseContainer", { timeout: 180_000 }, () => { // } // connectWithUrl { - it("should connect using the URL", async () => { + it.concurrent("should connect using the URL", async () => { const container = await new ClickHouseContainer(IMAGE).start(); const client = createClient({ url: container.getConnectionUrl(), @@ -47,7 +47,7 @@ describe("ClickHouseContainer", { timeout: 180_000 }, () => { // } // connectWithUsernameAndPassword { - it("should connect using the username and password", async () => { + it.concurrent("should connect using the username and password", async () => { const container = await new ClickHouseContainer(IMAGE) .withUsername("customUsername") .withPassword("customPassword") @@ -73,7 +73,7 @@ describe("ClickHouseContainer", { timeout: 180_000 }, () => { // } // setDatabase { - it("should set database", async () => { + it.concurrent("should set database", async () => { const customDatabase = "customDatabase"; const container = await new ClickHouseContainer(IMAGE).withDatabase(customDatabase).start(); @@ -93,7 +93,7 @@ describe("ClickHouseContainer", { timeout: 180_000 }, () => { // } // setUsername { - it("should set username", async () => { + it.concurrent("should set username", async () => { const customUsername = "customUsername"; const container = await new ClickHouseContainer(IMAGE).withUsername(customUsername).start(); @@ -112,7 +112,7 @@ describe("ClickHouseContainer", { timeout: 180_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new ClickHouseContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/cockroachdb/src/cockroachdb-container.test.ts b/packages/modules/cockroachdb/src/cockroachdb-container.test.ts index 5dbbe7f8a..63f9e8b1b 100644 --- a/packages/modules/cockroachdb/src/cockroachdb-container.test.ts +++ b/packages/modules/cockroachdb/src/cockroachdb-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("CockroachDbContainer", { timeout: 180_000 }, () => { // connect { - it("should connect and return a query result", async () => { + it.concurrent("should connect and return a query result", async () => { const container = await new CockroachDbContainer(IMAGE).start(); const client = new Client({ @@ -28,7 +28,7 @@ describe("CockroachDbContainer", { timeout: 180_000 }, () => { // } // uriConnect { - it("should work with database URI", async () => { + it.concurrent("should work with database URI", async () => { const container = await new CockroachDbContainer(IMAGE).start(); const client = new Client({ @@ -45,7 +45,7 @@ describe("CockroachDbContainer", { timeout: 180_000 }, () => { // } // setDatabase { - it("should set database", async () => { + it.concurrent("should set database", async () => { const container = await new CockroachDbContainer(IMAGE).withDatabase("custom_database").start(); const client = new Client({ @@ -65,7 +65,7 @@ describe("CockroachDbContainer", { timeout: 180_000 }, () => { // } // setUsername { - it("should set username", async () => { + it.concurrent("should set username", async () => { const container = await new CockroachDbContainer(IMAGE).withUsername("custom_username").start(); const client = new Client({ @@ -84,7 +84,7 @@ describe("CockroachDbContainer", { timeout: 180_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new CockroachDbContainer(IMAGE).start(); await container.restart(); @@ -103,7 +103,7 @@ describe("CockroachDbContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should allow custom healthcheck", async () => { + it.concurrent("should allow custom healthcheck", async () => { const container = new CockroachDbContainer(IMAGE).withHealthCheck({ test: ["CMD-SHELL", "exit 1"], interval: 100, diff --git a/packages/modules/couchbase/src/couchbase-container.test.ts b/packages/modules/couchbase/src/couchbase-container.test.ts index 8197e00ed..b328e6f89 100644 --- a/packages/modules/couchbase/src/couchbase-container.test.ts +++ b/packages/modules/couchbase/src/couchbase-container.test.ts @@ -45,7 +45,7 @@ describe("CouchbaseContainer", { timeout: 180_000 }, () => { }); // connectAndQuery { - it("should connect and query using enterprise image", async () => { + it.concurrent("should connect and query using enterprise image", async () => { const bucketDefinition = new BucketDefinition("mybucket"); const container = new CouchbaseContainer(COUCHBASE_IMAGE_ENTERPRISE).withBucket(bucketDefinition); @@ -63,7 +63,7 @@ describe("CouchbaseContainer", { timeout: 180_000 }, () => { }); // } - it("should flush bucket if flushEnabled and check any document exists", async () => { + it.concurrent("should flush bucket if flushEnabled and check any document exists", async () => { const bucketDefinition = new BucketDefinition("mybucket").withFlushEnabled(true); const container = new CouchbaseContainer(COUCHBASE_IMAGE_ENTERPRISE).withBucket(bucketDefinition); @@ -100,7 +100,7 @@ describe("CouchbaseContainer", { timeout: 180_000 }, () => { } }); - it("should connect and query using community image", async () => { + it.concurrent("should connect and query using community image", async () => { const bucketDefinition = new BucketDefinition("mybucket"); const container = new CouchbaseContainer(COUCHBASE_IMAGE_COMMUNITY).withBucket(bucketDefinition); @@ -116,7 +116,7 @@ describe("CouchbaseContainer", { timeout: 180_000 }, () => { expect(result.content).toEqual({ foo: "bar" }); }); - it("should flush bucket if flushEnabled and check any document exists", async () => { + it.concurrent("should flush bucket if flushEnabled and check any document exists", async () => { const bucketDefinition = new BucketDefinition("mybucket").withFlushEnabled(true); const container = new CouchbaseContainer(COUCHBASE_IMAGE_COMMUNITY).withBucket(bucketDefinition); @@ -136,7 +136,7 @@ describe("CouchbaseContainer", { timeout: 180_000 }, () => { expect(existResult.exists).toBe(false); }); - it("should throw error if analytics service enabled with community version", async () => { + it.concurrent("should throw error if analytics service enabled with community version", async () => { const container = new CouchbaseContainer(COUCHBASE_IMAGE_COMMUNITY).withEnabledServices( CouchbaseService.KV, CouchbaseService.ANALYTICS @@ -147,7 +147,7 @@ describe("CouchbaseContainer", { timeout: 180_000 }, () => { ); }); - it("should throw error if eventing service enabled with community version", async () => { + it.concurrent("should throw error if eventing service enabled with community version", async () => { const container = new CouchbaseContainer(COUCHBASE_IMAGE_COMMUNITY).withEnabledServices( CouchbaseService.KV, CouchbaseService.EVENTING diff --git a/packages/modules/elasticsearch/src/elasticsearch-container.test.ts b/packages/modules/elasticsearch/src/elasticsearch-container.test.ts index 15ff0399d..5732d7521 100644 --- a/packages/modules/elasticsearch/src/elasticsearch-container.test.ts +++ b/packages/modules/elasticsearch/src/elasticsearch-container.test.ts @@ -22,7 +22,7 @@ describe("ElasticsearchContainer", { timeout: 180_000 }, () => { // } // indexDocument { - it("should index a document", async () => { + it.concurrent("should index a document", async () => { const container = await new ElasticsearchContainer(IMAGE).start(); const client = new Client({ node: container.getHttpUrl(), @@ -44,7 +44,7 @@ describe("ElasticsearchContainer", { timeout: 180_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new ElasticsearchContainer(IMAGE).start(); await container.restart(); @@ -59,7 +59,7 @@ describe("ElasticsearchContainer", { timeout: 180_000 }, () => { await container.stop(); }); // } - it("should set custom password", async () => { + it.concurrent("should set custom password", async () => { const container = await new ElasticsearchContainer(IMAGE).withPassword("testPassword").start(); const client = new Client({ diff --git a/packages/modules/etcd/src/etcd-container.test.ts b/packages/modules/etcd/src/etcd-container.test.ts index f8fbf333d..b153a8bb0 100644 --- a/packages/modules/etcd/src/etcd-container.test.ts +++ b/packages/modules/etcd/src/etcd-container.test.ts @@ -6,14 +6,14 @@ import { EtcdContainer, StartedEtcdContainer } from "./etcd-container"; const IMAGE = getImage(__dirname); describe("etcd", () => { - it("should construct a container", { timeout: 30_000 }, async () => { + it.concurrent("should construct a container", { timeout: 30_000 }, async () => { const container = await new EtcdContainer(IMAGE).start(); expect(container).toBeInstanceOf(StartedEtcdContainer); container.stop(); }); // readWrite { - it("should connect and perform read/write operations", async () => { + it.concurrent("should connect and perform read/write operations", async () => { const container = await new EtcdContainer(IMAGE).start(); const client = new Etcd3({ hosts: container.getClientEndpoint(), @@ -30,7 +30,7 @@ describe("etcd", () => { // } // subscribe { - it("should subscribe to key changes", async () => { + it.concurrent("should subscribe to key changes", async () => { const subscriber = vi.fn(); const container = await new EtcdContainer(IMAGE).start(); const client = new Etcd3({ diff --git a/packages/modules/gcloud/src/bigquery-emulator-container.test.ts b/packages/modules/gcloud/src/bigquery-emulator-container.test.ts index e5c16e6b7..d21cd6103 100644 --- a/packages/modules/gcloud/src/bigquery-emulator-container.test.ts +++ b/packages/modules/gcloud/src/bigquery-emulator-container.test.ts @@ -5,7 +5,7 @@ import { BigQueryEmulatorContainer, StartedBigQueryEmulatorContainer } from "./b const IMAGE = getImage(__dirname, 2); describe("BigQueryEmulatorContainer", { timeout: 240_000 }, () => { - it("should work using default version", async () => { + it.concurrent("should work using default version", async () => { const bigQueryEmulatorContainer = await new BigQueryEmulatorContainer(IMAGE).start(); await checkBigQuery(bigQueryEmulatorContainer); diff --git a/packages/modules/gcloud/src/cloudstorage-emulator-container.test.ts b/packages/modules/gcloud/src/cloudstorage-emulator-container.test.ts index 8ffd6a581..2188e8b14 100644 --- a/packages/modules/gcloud/src/cloudstorage-emulator-container.test.ts +++ b/packages/modules/gcloud/src/cloudstorage-emulator-container.test.ts @@ -48,7 +48,7 @@ describe("CloudStorageEmulatorContainer", { timeout: 240_000 }, () => { }); // cloud-storage { - it("should work using default version", async () => { + it.concurrent("should work using default version", async () => { const cloudstorageEmulatorContainer = await new CloudStorageEmulatorContainer(IMAGE).start(); await checkCloudStorage(cloudstorageEmulatorContainer); @@ -57,7 +57,7 @@ describe("CloudStorageEmulatorContainer", { timeout: 240_000 }, () => { }); // } - it("should use the provided external URL", async () => { + it.concurrent("should use the provided external URL", async () => { const cloudstorageEmulatorContainer = await new CloudStorageEmulatorContainer(IMAGE) .withExternalURL("http://cdn.company.local") .start(); @@ -68,7 +68,7 @@ describe("CloudStorageEmulatorContainer", { timeout: 240_000 }, () => { await cloudstorageEmulatorContainer.stop(); }); - it("should be able update the external URL of running instance", async () => { + it.concurrent("should be able update the external URL of running instance", async () => { const cloudstorageEmulatorContainer = await new CloudStorageEmulatorContainer(IMAGE) .withExternalURL("http://cdn.company.local") .start(); @@ -106,7 +106,7 @@ describe("CloudStorageEmulatorContainer", { timeout: 240_000 }, () => { await cloudstorageEmulatorContainer.stop(); }); - it("should use emulator endpoint as default external URL", async () => { + it.concurrent("should use emulator endpoint as default external URL", async () => { let configUpdated = false; server.events.on("request:start", ({ request }) => { @@ -122,7 +122,7 @@ describe("CloudStorageEmulatorContainer", { timeout: 240_000 }, () => { await container.stop(); }); - it("should allow skipping updating the external URL automatically", async () => { + it.concurrent("should allow skipping updating the external URL automatically", async () => { let configUpdated = false; server.events.on("request:start", ({ request }) => { diff --git a/packages/modules/gcloud/src/datastore-emulator-container.test.ts b/packages/modules/gcloud/src/datastore-emulator-container.test.ts index d3c03c1b0..65b1563ea 100644 --- a/packages/modules/gcloud/src/datastore-emulator-container.test.ts +++ b/packages/modules/gcloud/src/datastore-emulator-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("DatastoreEmulatorContainer", { timeout: 240_000 }, () => { // datastore4 { - it("should work using default version", async () => { + it.concurrent("should work using default version", async () => { const datastoreEmulatorContainer = await new DatastoreEmulatorContainer(IMAGE).start(); await checkDatastore(datastoreEmulatorContainer); @@ -16,7 +16,7 @@ describe("DatastoreEmulatorContainer", { timeout: 240_000 }, () => { // } // datastore5 { - it("should work using version 468.0.0", async () => { + it.concurrent("should work using version 468.0.0", async () => { const datastoreEmulatorContainer = await new DatastoreEmulatorContainer( "gcr.io/google.com/cloudsdktool/google-cloud-cli:468.0.0-emulators" ).start(); diff --git a/packages/modules/gcloud/src/emulator-flags-manager.test.ts b/packages/modules/gcloud/src/emulator-flags-manager.test.ts index 15df56b5a..0f331199c 100644 --- a/packages/modules/gcloud/src/emulator-flags-manager.test.ts +++ b/packages/modules/gcloud/src/emulator-flags-manager.test.ts @@ -1,7 +1,7 @@ import { EmulatorFlagsManager } from "./emulator-flags-manager"; describe("EmulatorFlagsManager", () => { - it("should add flag without --", async () => { + it.concurrent("should add flag without --", async () => { const flagsManager = new EmulatorFlagsManager().withFlag("database-mode", "firestore-native"); const flags = flagsManager.expandFlags(); @@ -9,7 +9,7 @@ describe("EmulatorFlagsManager", () => { expect(flags.trim()).toEqual("--database-mode=firestore-native"); }); - it("should add flag with --", async () => { + it.concurrent("should add flag with --", async () => { const flagsManager = new EmulatorFlagsManager().withFlag("--database-mode", "firestore-native"); const flags = flagsManager.expandFlags(); @@ -17,7 +17,7 @@ describe("EmulatorFlagsManager", () => { expect(flags.trim()).toEqual("--database-mode=firestore-native"); }); - it("should add many flags", async () => { + it.concurrent("should add many flags", async () => { const flagsManager = new EmulatorFlagsManager() .withFlag("database-mode", "firestore-native") .withFlag("--host-port", "0.0.0.0:8080"); @@ -27,7 +27,7 @@ describe("EmulatorFlagsManager", () => { expect(flags.trim()).toEqual("--database-mode=firestore-native --host-port=0.0.0.0:8080"); }); - it("should overwrite same flag if added more than once", async () => { + it.concurrent("should overwrite same flag if added more than once", async () => { const flagsManager = new EmulatorFlagsManager() .withFlag("database-mode", "firestore-native") .withFlag("--database-mode", "datastore-mode"); @@ -37,7 +37,7 @@ describe("EmulatorFlagsManager", () => { expect(flags.trim()).toEqual("--database-mode=datastore-mode"); }); - it("should add flag with no value", async () => { + it.concurrent("should add flag with no value", async () => { const flagsManager = new EmulatorFlagsManager().withFlag("database-mode", "").withFlag("--host-port", ""); const flags = flagsManager.expandFlags(); @@ -45,11 +45,11 @@ describe("EmulatorFlagsManager", () => { expect(flags.trim()).toEqual("--database-mode --host-port"); }); - it("should throw if flag name not set", async () => { + it.concurrent("should throw if flag name not set", async () => { expect(() => new EmulatorFlagsManager().withFlag("", "firestore-native")).toThrowError(); }); - it("should clear all flags added", async () => { + it.concurrent("should clear all flags added", async () => { const flagsManager = new EmulatorFlagsManager() .withFlag("database-mode", "firestore-native") .withFlag("host-port", "0.0.0.0:8080"); diff --git a/packages/modules/gcloud/src/firestore-emulator-container.test.ts b/packages/modules/gcloud/src/firestore-emulator-container.test.ts index 6f8796c60..c67e441dd 100644 --- a/packages/modules/gcloud/src/firestore-emulator-container.test.ts +++ b/packages/modules/gcloud/src/firestore-emulator-container.test.ts @@ -10,7 +10,7 @@ describe("FirestoreEmulatorContainer", { timeout: 240_000 }, () => { }); // firestore4 { - it("should work using default version", async () => { + it.concurrent("should work using default version", async () => { const firestoreEmulatorContainer = await new FirestoreEmulatorContainer(IMAGE).start(); await checkFirestore(firestoreEmulatorContainer); @@ -20,7 +20,7 @@ describe("FirestoreEmulatorContainer", { timeout: 240_000 }, () => { // } // firestore5 { - it("should work using version 468.0.0", async () => { + it.concurrent("should work using version 468.0.0", async () => { const firestoreEmulatorContainer = await new FirestoreEmulatorContainer( "gcr.io/google.com/cloudsdktool/google-cloud-cli:468.0.0-emulators" ).start(); diff --git a/packages/modules/gcloud/src/pubsub-emulator-container.test.ts b/packages/modules/gcloud/src/pubsub-emulator-container.test.ts index 2d3fcb67f..708d41944 100644 --- a/packages/modules/gcloud/src/pubsub-emulator-container.test.ts +++ b/packages/modules/gcloud/src/pubsub-emulator-container.test.ts @@ -5,7 +5,7 @@ import { PubSubEmulatorContainer, StartedPubSubEmulatorContainer } from "./pubsu const IMAGE = getImage(__dirname); describe("PubSubEmulatorContainer", { timeout: 240_000 }, () => { - it("should work using default version", async () => { + it.concurrent("should work using default version", async () => { const pubsubEmulatorContainer = await new PubSubEmulatorContainer(IMAGE).start(); await checkPubSub(pubsubEmulatorContainer); diff --git a/packages/modules/hivemq/src/hivemq-container.test.ts b/packages/modules/hivemq/src/hivemq-container.test.ts index b88c63f8b..671590602 100644 --- a/packages/modules/hivemq/src/hivemq-container.test.ts +++ b/packages/modules/hivemq/src/hivemq-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("HiveMQContainer", { timeout: 240_000 }, () => { // connect { - it("should connect to HiveMQ Community Edition via MQTT.js", async () => { + it.concurrent("should connect to HiveMQ Community Edition via MQTT.js", async () => { const container = await new HiveMQContainer(IMAGE).start(); const testMqttClient = mqtt.connect(container.getConnectionString()); diff --git a/packages/modules/k3s/src/k3s-container.test.ts b/packages/modules/k3s/src/k3s-container.test.ts index 2d380f9da..2bcf05c53 100644 --- a/packages/modules/k3s/src/k3s-container.test.ts +++ b/packages/modules/k3s/src/k3s-container.test.ts @@ -4,13 +4,13 @@ import { GenericContainer, Network, Wait } from "testcontainers"; import { K3sContainer } from "./k3s-container"; describe("K3s", { timeout: 120_000 }, () => { - it("should construct", () => { + it.concurrent("should construct", () => { new K3sContainer("rancher/k3s:v1.31.2-k3s1"); }); // K3sContainer runs as a privileged container if (!process.env["CI_ROOTLESS"]) { - it("should start and have listable node", async () => { + it.concurrent("should start and have listable node", async () => { // starting_k3s { const container = await new K3sContainer("rancher/k3s:v1.31.2-k3s1").start(); // } @@ -33,7 +33,7 @@ describe("K3s", { timeout: 120_000 }, () => { await container.stop(); }); - it("should expose kubeconfig for a network alias", async () => { + it.concurrent("should expose kubeconfig for a network alias", async () => { const network = await new Network().start(); const container = await new K3sContainer("rancher/k3s:v1.31.2-k3s1") .withNetwork(network) @@ -62,7 +62,7 @@ describe("K3s", { timeout: 120_000 }, () => { await network.stop(); }); - it("should start a pod", async () => { + it.concurrent("should start a pod", async () => { const container = await new K3sContainer("rancher/k3s:v1.31.2-k3s1").start(); const kc = new k8s.KubeConfig(); kc.loadFromString(container.getKubeConfig()); diff --git a/packages/modules/kafka/src/kafka-container-7.test.ts b/packages/modules/kafka/src/kafka-container-7.test.ts index e4df2f51a..42941ef22 100644 --- a/packages/modules/kafka/src/kafka-container-7.test.ts +++ b/packages/modules/kafka/src/kafka-container-7.test.ts @@ -8,7 +8,7 @@ const IMAGE = "confluentinc/cp-kafka:7.9.1"; describe("KafkaContainer", { timeout: 240_000 }, () => { // connectBuiltInZK { - it("should connect using in-built zoo-keeper", async () => { + it.concurrent("should connect using in-built zoo-keeper", async () => { const kafkaContainer = await new KafkaContainer(IMAGE).start(); await testPubSub(kafkaContainer); @@ -17,7 +17,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // } - it("should connect using in-built zoo-keeper and custom images", async () => { + it.concurrent("should connect using in-built zoo-keeper and custom images", async () => { const kafkaContainer = await new KafkaContainer(IMAGE).start(); await testPubSub(kafkaContainer); @@ -25,7 +25,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { await kafkaContainer.stop(); }); - it("should connect using in-built zoo-keeper and custom network", async () => { + it.concurrent("should connect using in-built zoo-keeper and custom network", async () => { const network = await new Network().start(); const kafkaContainer = await new KafkaContainer(IMAGE).withNetwork(network).start(); @@ -37,7 +37,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // connectProvidedZK { - it("should connect using provided zoo-keeper and network", async () => { + it.concurrent("should connect using provided zoo-keeper and network", async () => { const network = await new Network().start(); const zooKeeperHost = "zookeeper"; @@ -62,7 +62,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // } - it("should be reusable", async () => { + it.concurrent("should be reusable", async () => { const originalKafkaContainer = await new KafkaContainer(IMAGE).withReuse().start(); const newKafkaContainer = await new KafkaContainer(IMAGE).withReuse().start(); @@ -84,7 +84,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { const certificatesDir = path.resolve(__dirname, "..", "test-certs"); // ssl { - it(`should connect locally`, async () => { + it.concurrent(`should connect locally`, async () => { const kafkaContainer = await new KafkaContainer("confluentinc/cp-kafka:7.5.0").withSaslSslListener({ port: 9096, sasl: { @@ -121,7 +121,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // } - it(`should connect within Docker network`, async () => { + it.concurrent(`should connect within Docker network`, async () => { const network = await new Network().start(); const kafkaContainer = await new KafkaContainer(IMAGE) @@ -189,7 +189,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // connectKraft { - it("should connect using kraft", async () => { + it.concurrent("should connect using kraft", async () => { const kafkaContainer = await new KafkaContainer(IMAGE).withKraft().start(); await testPubSub(kafkaContainer); @@ -198,13 +198,13 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // } - it("should throw an error when using kraft and and confluence platfom below 7.0.0", async () => { + it.concurrent("should throw an error when using kraft and and confluence platfom below 7.0.0", async () => { expect(() => new KafkaContainer("confluentinc/cp-kafka:6.2.14").withKraft()).toThrow( "Provided Confluent Platform's version 6.2.14 is not supported in Kraft mode (must be 7.0.0 or above)" ); }); - it("should connect using kraft and custom network", async () => { + it.concurrent("should connect using kraft and custom network", async () => { const network = await new Network().start(); const kafkaContainer = await new KafkaContainer(IMAGE).withKraft().withNetwork(network).start(); @@ -214,7 +214,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { await network.stop(); }); - it("should throw an error when using kraft wit sasl and confluence platfom below 7.5.0", async () => { + it.concurrent("should throw an error when using kraft wit sasl and confluence platfom below 7.5.0", async () => { const kafkaContainer = new KafkaContainer("confluentinc/cp-kafka:7.4.0").withKraft().withSaslSslListener({ port: 9094, sasl: { diff --git a/packages/modules/kafka/src/kafka-container-latest.test.ts b/packages/modules/kafka/src/kafka-container-latest.test.ts index 96a7fb041..287f45bd4 100644 --- a/packages/modules/kafka/src/kafka-container-latest.test.ts +++ b/packages/modules/kafka/src/kafka-container-latest.test.ts @@ -11,7 +11,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { const certificatesDir = path.resolve(__dirname, "..", "test-certs"); // connectKafkaLatest { - it("should connect", async () => { + it.concurrent("should connect", async () => { const kafkaContainer = await new KafkaContainer(IMAGE).start(); await testPubSub(kafkaContainer); @@ -20,7 +20,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // } - it("should connect with custom network", async () => { + it.concurrent("should connect with custom network", async () => { const network = await new Network().start(); const kafkaContainer = await new KafkaContainer(IMAGE).withNetwork(network).start(); @@ -30,7 +30,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { await network.stop(); }); - it("should be reusable", async () => { + it.concurrent("should be reusable", async () => { const originalKafkaContainer = await new KafkaContainer(IMAGE).withReuse().start(); const newKafkaContainer = await new KafkaContainer(IMAGE).withReuse().start(); @@ -40,7 +40,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // ssl { - it(`should connect with SASL`, async () => { + it.concurrent(`should connect with SASL`, async () => { const saslConfig: SaslSslListenerOptions = { port: 9096, sasl: { @@ -78,7 +78,7 @@ describe("KafkaContainer", { timeout: 240_000 }, () => { }); // } - it(`should connect with SASL in custom network`, async () => { + it.concurrent(`should connect with SASL in custom network`, async () => { const network = await new Network().start(); const saslConfig: SaslSslListenerOptions = { diff --git a/packages/modules/kurrentdb/src/kurrentdb-container.test.ts b/packages/modules/kurrentdb/src/kurrentdb-container.test.ts index f8cf0d10a..e50e4b6c3 100644 --- a/packages/modules/kurrentdb/src/kurrentdb-container.test.ts +++ b/packages/modules/kurrentdb/src/kurrentdb-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("KurrentDbContainer", { timeout: 240_000 }, () => { // startContainer { - it("should execute write and read", async () => { + it.concurrent("should execute write and read", async () => { const container = await new KurrentDbContainer(IMAGE).start(); const client = KurrentDBClient.connectionString(container.getConnectionString()); @@ -46,7 +46,7 @@ describe("KurrentDbContainer", { timeout: 240_000 }, () => { // } // usingStandardProjections { - it("should use built-in projections", async () => { + it.concurrent("should use built-in projections", async () => { const container = await new KurrentDbContainer(IMAGE).start(); const client = KurrentDBClient.connectionString(container.getConnectionString()); diff --git a/packages/modules/localstack/src/localstack-container.test.ts b/packages/modules/localstack/src/localstack-container.test.ts index 797a69bfa..98a23fa0e 100644 --- a/packages/modules/localstack/src/localstack-container.test.ts +++ b/packages/modules/localstack/src/localstack-container.test.ts @@ -18,7 +18,7 @@ const runAwsCliAgainstDockerNetworkContainer = async ( describe("LocalStackContainer", { timeout: 180_000 }, () => { // createS3Bucket { - it("should create a S3 bucket", async () => { + it.concurrent("should create a S3 bucket", async () => { const container = await new LocalstackContainer(IMAGE).start(); const client = new S3Client({ @@ -44,7 +44,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => { }); // } - it("should use custom network", async () => { + it.concurrent("should use custom network", async () => { const network = await new Network().start(); const container = await new LocalstackContainer(IMAGE) .withNetwork(network) @@ -73,7 +73,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => { await network.stop(); }); - it("should not override LOCALSTACK_HOST assignment", async () => { + it.concurrent("should not override LOCALSTACK_HOST assignment", async () => { const container = await new LocalstackContainer(IMAGE) .withEnvironment({ LOCALSTACK_HOST: "myhost" }) .withNetworkAliases("myalias") @@ -86,7 +86,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should override LOCALSTACK_HOST with last network alias", async () => { + it.concurrent("should override LOCALSTACK_HOST with last network alias", async () => { const container = await new LocalstackContainer(IMAGE).withNetworkAliases("other", "myalias").start(); const { output, exitCode } = await container.exec(["printenv", "LOCALSTACK_HOST"]); @@ -96,7 +96,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should assign LOCALSTACK_HOST to localhost", async () => { + it.concurrent("should assign LOCALSTACK_HOST to localhost", async () => { const container = await new LocalstackContainer(IMAGE).start(); const { output, exitCode } = await container.exec(["printenv", "LOCALSTACK_HOST"]); @@ -106,7 +106,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should add LAMBDA_DOCKER_FLAGS with sessionId label", async () => { + it.concurrent("should add LAMBDA_DOCKER_FLAGS with sessionId label", async () => { const container = await new LocalstackContainer(IMAGE).start(); const sessionId = container.getLabels()[LABEL_TESTCONTAINERS_SESSION_ID]; @@ -115,7 +115,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => { expect(output).toContain(`${LABEL_TESTCONTAINERS_SESSION_ID}=${sessionId}`); }); - it("should concatenate sessionId label to LAMBDA_DOCKER_FLAGS", async () => { + it.concurrent("should concatenate sessionId label to LAMBDA_DOCKER_FLAGS", async () => { const container = await new LocalstackContainer(IMAGE) .withEnvironment({ LAMBDA_DOCKER_FLAGS: `-l mylabel=myvalue`, diff --git a/packages/modules/mariadb/src/mariadb-container.test.ts b/packages/modules/mariadb/src/mariadb-container.test.ts index 21078a817..bd666d708 100644 --- a/packages/modules/mariadb/src/mariadb-container.test.ts +++ b/packages/modules/mariadb/src/mariadb-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("MariaDb", { timeout: 240_000 }, () => { // connect { - it("should connect and execute query", async () => { + it.concurrent("should connect and execute query", async () => { const container = await new MariaDbContainer(IMAGE).start(); const client = await mariadb.createConnection({ @@ -26,7 +26,7 @@ describe("MariaDb", { timeout: 240_000 }, () => { // } // uriConnect { - it("should work with database URI", async () => { + it.concurrent("should work with database URI", async () => { const username = "testUser"; const password = "testPassword"; const database = "testDB"; @@ -52,7 +52,7 @@ describe("MariaDb", { timeout: 240_000 }, () => { // } // setDatabase { - it("should set database", async () => { + it.concurrent("should set database", async () => { const container = await new MariaDbContainer(IMAGE).withDatabase("customDatabase").start(); const client = await mariadb.createConnection({ @@ -72,7 +72,7 @@ describe("MariaDb", { timeout: 240_000 }, () => { // } // setUsername { - it("should set username", async () => { + it.concurrent("should set username", async () => { const container = await new MariaDbContainer(IMAGE).withUsername("customUsername").start(); const client = await mariadb.createConnection({ @@ -92,7 +92,7 @@ describe("MariaDb", { timeout: 240_000 }, () => { // } // insertAndFetchData { - it("should create a table, insert a row, and fetch that row", async () => { + it.concurrent("should create a table, insert a row, and fetch that row", async () => { const container = await new MariaDbContainer(IMAGE).start(); const client = await mariadb.createConnection({ @@ -127,7 +127,7 @@ describe("MariaDb", { timeout: 240_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new MariaDbContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/minio/src/minio-container.test.ts b/packages/modules/minio/src/minio-container.test.ts index b636a444e..a5e90e2da 100644 --- a/packages/modules/minio/src/minio-container.test.ts +++ b/packages/modules/minio/src/minio-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("MinIO", { timeout: 240_000 }, () => { // connectWithDefaultCredentials { - it("should connect and upload a file", async () => { + it.concurrent("should connect and upload a file", async () => { const container = await new MinioContainer(IMAGE).start(); const minioClient = new minio.Client({ @@ -36,7 +36,7 @@ describe("MinIO", { timeout: 240_000 }, () => { // } // connectWithCustomCredentials { - it("should work with custom credentials", async () => { + it.concurrent("should work with custom credentials", async () => { const container = await new MinioContainer(IMAGE).withUsername("AzureDiamond").withPassword("hunter2!").start(); const minioClient = new minio.Client({ diff --git a/packages/modules/mockserver/src/mockserver-container.test.ts b/packages/modules/mockserver/src/mockserver-container.test.ts index 392261923..d28f43d84 100644 --- a/packages/modules/mockserver/src/mockserver-container.test.ts +++ b/packages/modules/mockserver/src/mockserver-container.test.ts @@ -7,7 +7,7 @@ const IMAGE = getImage(__dirname); describe("MockserverContainer", { timeout: 240_000 }, () => { // startContainer { - it("should start and accept mocks", async () => { + it.concurrent("should start and accept mocks", async () => { const container = await new MockserverContainer(IMAGE).start(); const client = mockServerClient(container.getHost(), container.getMockserverPort()); const url = container.getUrl(); @@ -32,7 +32,7 @@ describe("MockserverContainer", { timeout: 240_000 }, () => { }); // } - it("should return an https url", async () => { + it.concurrent("should return an https url", async () => { const container = await new MockserverContainer(IMAGE).start(); const secureUrl = container.getSecureUrl(); await container.stop(); @@ -40,7 +40,7 @@ describe("MockserverContainer", { timeout: 240_000 }, () => { }); // httpsRequests { - it("should respond to https requests", async () => { + it.concurrent("should respond to https requests", async () => { const container = await new MockserverContainer(IMAGE).start(); const client = mockServerClient(container.getHost(), container.getMockserverPort()); diff --git a/packages/modules/mongodb/src/mongodb-container.test.ts b/packages/modules/mongodb/src/mongodb-container.test.ts index b038a64dd..e486a4205 100644 --- a/packages/modules/mongodb/src/mongodb-container.test.ts +++ b/packages/modules/mongodb/src/mongodb-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("MongodbContainer", { timeout: 240_000 }, () => { // connect4 { - it("should work using default version 4.0.1", async () => { + it.concurrent("should work using default version 4.0.1", async () => { const mongodbContainer = await new MongoDBContainer(IMAGE).start(); // directConnection: true is required as the testcontainer is created as a MongoDB Replica Set. @@ -36,7 +36,7 @@ describe("MongodbContainer", { timeout: 240_000 }, () => { // } // connect6 { - it("should work using version 6.0.1", async () => { + it.concurrent("should work using version 6.0.1", async () => { const mongodbContainer = await new MongoDBContainer("mongo:6.0.1").start(); // directConnection: true is required as the testcontainer is created as a MongoDB Replica Set. diff --git a/packages/modules/mssqlserver/src/mssqlserver-container.test.ts b/packages/modules/mssqlserver/src/mssqlserver-container.test.ts index 813493854..e1def985f 100644 --- a/packages/modules/mssqlserver/src/mssqlserver-container.test.ts +++ b/packages/modules/mssqlserver/src/mssqlserver-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("MSSqlServerContainer", { timeout: 180_000 }, () => { // connect { - it("should connect and return a query result", async () => { + it.concurrent("should connect and return a query result", async () => { const container = await new MSSQLServerContainer(IMAGE).acceptLicense().start(); const sqlConfig: config = { @@ -36,7 +36,7 @@ describe("MSSqlServerContainer", { timeout: 180_000 }, () => { // } // uriConnect { - it("should connect and return a query result with database URI", async () => { + it.concurrent("should connect and return a query result with database URI", async () => { const container = await new MSSQLServerContainer(IMAGE).acceptLicense().start(); const connectionString = container.getConnectionUri(); @@ -51,7 +51,7 @@ describe("MSSqlServerContainer", { timeout: 180_000 }, () => { // } // validPassword { - it("should connect and return a query result with valid custom password", async () => { + it.concurrent("should connect and return a query result with valid custom password", async () => { const container = await new MSSQLServerContainer(IMAGE).acceptLicense().withPassword("I!@M#$eCur3").start(); const connectionString = container.getConnectionUri(); @@ -66,7 +66,7 @@ describe("MSSqlServerContainer", { timeout: 180_000 }, () => { // } // invalidPassword { - it("should throw error with invalid password", async () => { + it.concurrent("should throw error with invalid password", async () => { const container = new MSSQLServerContainer(IMAGE).acceptLicense().withPassword("password"); await expect(container.start()).rejects.toThrow( Error('Log stream ended and message "/.*Recovery is complete.*/" was not received') @@ -75,7 +75,7 @@ describe("MSSqlServerContainer", { timeout: 180_000 }, () => { // } // expressEdition { - it("should start db with express edition", async () => { + it.concurrent("should start db with express edition", async () => { const container = await new MSSQLServerContainer(IMAGE) .withWaitForMessage(/.*Attribute synchronization manager initialized*/) .acceptLicense() diff --git a/packages/modules/mysql/src/mysql-container.test.ts b/packages/modules/mysql/src/mysql-container.test.ts index cc6b80484..4c2a942e2 100644 --- a/packages/modules/mysql/src/mysql-container.test.ts +++ b/packages/modules/mysql/src/mysql-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("MySqlContainer", { timeout: 240_000 }, () => { // connect { - it("should connect and execute query", async () => { + it.concurrent("should connect and execute query", async () => { const container = await new MySqlContainer(IMAGE).start(); const client = await createConnection({ @@ -26,7 +26,7 @@ describe("MySqlContainer", { timeout: 240_000 }, () => { // } // uriConnect { - it("should work with database URI", async () => { + it.concurrent("should work with database URI", async () => { const username = "testUser"; const password = "testPassword"; const database = "testDB"; @@ -52,7 +52,7 @@ describe("MySqlContainer", { timeout: 240_000 }, () => { // } // setDatabase { - it("should set database", async () => { + it.concurrent("should set database", async () => { const container = await new MySqlContainer(IMAGE).withDatabase("customDatabase").start(); const client = await createConnection({ @@ -72,7 +72,7 @@ describe("MySqlContainer", { timeout: 240_000 }, () => { // } // setUsername { - it("should set username", async () => { + it.concurrent("should set username", async () => { const container = await new MySqlContainer(IMAGE).withUsername("customUsername").start(); const client = await createConnection({ @@ -92,7 +92,7 @@ describe("MySqlContainer", { timeout: 240_000 }, () => { // } // executeQuery { - it("should execute a query and return the result", async () => { + it.concurrent("should execute a query and return the result", async () => { const container = await new MySqlContainer(IMAGE).start(); const queryResult = await container.executeQuery("SELECT 1 as res"); @@ -101,7 +101,7 @@ describe("MySqlContainer", { timeout: 240_000 }, () => { await container.stop(); }); - it("should execute a query as root user", async () => { + it.concurrent("should execute a query as root user", async () => { const container = await new MySqlContainer(IMAGE).withUsername("customUsername").start(); // Test non-root user @@ -116,7 +116,7 @@ describe("MySqlContainer", { timeout: 240_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new MySqlContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/nats/src/nats-container.test.ts b/packages/modules/nats/src/nats-container.test.ts index ef73b2a5a..7d595f4fd 100644 --- a/packages/modules/nats/src/nats-container.test.ts +++ b/packages/modules/nats/src/nats-container.test.ts @@ -7,7 +7,7 @@ const IMAGE = getImage(__dirname); describe("NatsContainer", { timeout: 180_000 }, () => { // connect { - it("should start, connect and close", async () => { + it.concurrent("should start, connect and close", async () => { const container = await new NatsContainer(IMAGE).start(); // establish connection @@ -22,7 +22,7 @@ describe("NatsContainer", { timeout: 180_000 }, () => { }); // } - it("should start, connect and close using scratch image", async () => { + it.concurrent("should start, connect and close using scratch image", async () => { const container = await new NatsContainer("nats:2.11").start(); // establish connection @@ -37,7 +37,7 @@ describe("NatsContainer", { timeout: 180_000 }, () => { }); // pubsub { - it("should subscribe and receive one published message", async () => { + it.concurrent("should subscribe and receive one published message", async () => { const SUBJECT = "HELLO"; const PAYLOAD = "WORLD"; @@ -69,7 +69,7 @@ describe("NatsContainer", { timeout: 180_000 }, () => { // } // credentials { - it("should start with alternative username and password ", async () => { + it.concurrent("should start with alternative username and password ", async () => { // set username and password like this const container = await new NatsContainer(IMAGE).withPass("1234").withUsername("George").start(); @@ -85,7 +85,7 @@ describe("NatsContainer", { timeout: 180_000 }, () => { // } // jetstream { - it("should start with JetStream ", async () => { + it.concurrent("should start with JetStream ", async () => { // enable JetStream const container = await new NatsContainer(IMAGE).withJetStream().start(); @@ -103,7 +103,7 @@ describe("NatsContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should fail without JetStream ", async () => { + it.concurrent("should fail without JetStream ", async () => { const container = await new NatsContainer(IMAGE).start(); const nc = await connect(container.getConnectionOptions()); @@ -121,7 +121,7 @@ describe("NatsContainer", { timeout: 180_000 }, () => { }); // } - it("should immediately end when started with version argument ", async () => { + it.concurrent("should immediately end when started with version argument ", async () => { // for the complete list of available arguments see: // See Command Line Options section inside [NATS docker image documentation](https://hub.docker.com/_/nats) async function outputVersionAndExit() { diff --git a/packages/modules/neo4j/src/neo4j-container.test.ts b/packages/modules/neo4j/src/neo4j-container.test.ts index 63d6894c4..282cc65d4 100755 --- a/packages/modules/neo4j/src/neo4j-container.test.ts +++ b/packages/modules/neo4j/src/neo4j-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("Neo4jContainer", { timeout: 180_000 }, () => { // createNode { - it("should create a person node", async () => { + it.concurrent("should create a person node", async () => { const container = await new Neo4jContainer(IMAGE).start(); const driver = neo4j.driver( container.getBoltUri(), @@ -27,7 +27,7 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => { // } // v5DefaultPassword { - it("should connect to neo4j:v5 with default password", async () => { + it.concurrent("should connect to neo4j:v5 with default password", async () => { const container = await new Neo4jContainer("neo4j:5.23.0").start(); const driver = neo4j.driver( container.getBoltUri(), @@ -48,7 +48,7 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => { // } // setPassword { - it("should connect with custom password", async () => { + it.concurrent("should connect with custom password", async () => { const container = await new Neo4jContainer(IMAGE).withPassword("xyz1234@!").start(); const driver = neo4j.driver( container.getBoltUri(), @@ -69,7 +69,7 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => { // } // apoc { - it("should have APOC plugin installed", async () => { + it.concurrent("should have APOC plugin installed", async () => { const container = await new Neo4jContainer(IMAGE).withApoc().withStartupTimeout(120_000).start(); const driver = neo4j.driver( container.getBoltUri(), @@ -88,7 +88,7 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => { // } // pluginsList { - it("should work with plugin list", async () => { + it.concurrent("should work with plugin list", async () => { const container = await new Neo4jContainer("neo4j:5.26.5") .withPlugins([Neo4jPlugin.APOC_EXTENDED, Neo4jPlugin.GRAPH_DATA_SCIENCE]) .withStartupTimeout(120_000) diff --git a/packages/modules/ollama/src/ollama-container.test.ts b/packages/modules/ollama/src/ollama-container.test.ts index c58d7cda6..75e57b3a5 100644 --- a/packages/modules/ollama/src/ollama-container.test.ts +++ b/packages/modules/ollama/src/ollama-container.test.ts @@ -5,7 +5,7 @@ import { OllamaContainer } from "./ollama-container"; const IMAGE = getImage(__dirname); describe("OllamaContainer", { timeout: 180_000 }, () => { - it("should run ollama with default config", async () => { + it.concurrent("should run ollama with default config", async () => { // container { const container = await new OllamaContainer(IMAGE).start(); // } diff --git a/packages/modules/postgresql/src/pgvector-container.test.ts b/packages/modules/postgresql/src/pgvector-container.test.ts index 9b3960fa4..4b631201d 100644 --- a/packages/modules/postgresql/src/pgvector-container.test.ts +++ b/packages/modules/postgresql/src/pgvector-container.test.ts @@ -5,7 +5,7 @@ import { PostgreSqlContainer } from "./postgresql-container"; const IMAGE = getImage(__dirname); describe("PgvectorContainer", { timeout: 180_000 }, () => { - it("should work", async () => { + it.concurrent("should work", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); const client = new Client({ @@ -24,7 +24,7 @@ describe("PgvectorContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should restart", async () => { + it.concurrent("should restart", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/postgresql/src/postgis-container.test.ts b/packages/modules/postgresql/src/postgis-container.test.ts index 8b40e5a7e..84b928f84 100644 --- a/packages/modules/postgresql/src/postgis-container.test.ts +++ b/packages/modules/postgresql/src/postgis-container.test.ts @@ -5,7 +5,7 @@ import { PostgreSqlContainer } from "./postgresql-container"; const IMAGE = getImage(__dirname); describe("PostgisContainer", { timeout: 180_000 }, () => { - it("should work", async () => { + it.concurrent("should work", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); const client = new Client({ @@ -24,7 +24,7 @@ describe("PostgisContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should restart", async () => { + it.concurrent("should restart", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/postgresql/src/postgresql-container-snapshot.test.ts b/packages/modules/postgresql/src/postgresql-container-snapshot.test.ts index 4636c7c03..94156966a 100644 --- a/packages/modules/postgresql/src/postgresql-container-snapshot.test.ts +++ b/packages/modules/postgresql/src/postgresql-container-snapshot.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () => { // createAndRestoreFromSnapshot { - it("should create and restore from snapshot", async () => { + it.concurrent("should create and restore from snapshot", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); // Connect to the database @@ -62,7 +62,7 @@ describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () => }); // } - it("should use custom snapshot name", async () => { + it.concurrent("should use custom snapshot name", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); const customSnapshotName = "my_custom_snapshot"; @@ -112,7 +112,7 @@ describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () => await container.stop(); }); - it("should handle multiple snapshots", async () => { + it.concurrent("should handle multiple snapshots", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); // Connect to the database @@ -195,7 +195,7 @@ describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () => await container.stop(); }); - it("should throw an error when trying to snapshot postgres system database", async () => { + it.concurrent("should throw an error when trying to snapshot postgres system database", async () => { const container = await new PostgreSqlContainer(IMAGE).withDatabase("postgres").start(); await expect(container.snapshot()).rejects.toThrow( diff --git a/packages/modules/postgresql/src/postgresql-container.test.ts b/packages/modules/postgresql/src/postgresql-container.test.ts index 826324e56..21263faad 100644 --- a/packages/modules/postgresql/src/postgresql-container.test.ts +++ b/packages/modules/postgresql/src/postgresql-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("PostgreSqlContainer", { timeout: 180_000 }, () => { // connect { - it("should connect and return a query result", async () => { + it.concurrent("should connect and return a query result", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); const client = new Client({ @@ -27,7 +27,7 @@ describe("PostgreSqlContainer", { timeout: 180_000 }, () => { // } // uriConnect { - it("should work with database URI", async () => { + it.concurrent("should work with database URI", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); const client = new Client({ @@ -44,7 +44,7 @@ describe("PostgreSqlContainer", { timeout: 180_000 }, () => { // } // setDatabase { - it("should set database", async () => { + it.concurrent("should set database", async () => { const container = await new PostgreSqlContainer(IMAGE).withDatabase("customDatabase").start(); const client = new Client({ @@ -65,7 +65,7 @@ describe("PostgreSqlContainer", { timeout: 180_000 }, () => { // } // setUsername { - it("should set username", async () => { + it.concurrent("should set username", async () => { const container = await new PostgreSqlContainer(IMAGE).withUsername("customUsername").start(); const client = new Client({ @@ -85,7 +85,7 @@ describe("PostgreSqlContainer", { timeout: 180_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); await container.restart(); @@ -105,7 +105,7 @@ describe("PostgreSqlContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should allow custom healthcheck", async () => { + it.concurrent("should allow custom healthcheck", async () => { const container = new PostgreSqlContainer(IMAGE).withHealthCheck({ test: ["CMD-SHELL", "exit 1"], interval: 100, diff --git a/packages/modules/postgresql/src/timescale-container.test.ts b/packages/modules/postgresql/src/timescale-container.test.ts index 988115a2b..264945042 100644 --- a/packages/modules/postgresql/src/timescale-container.test.ts +++ b/packages/modules/postgresql/src/timescale-container.test.ts @@ -5,7 +5,7 @@ import { PostgreSqlContainer } from "./postgresql-container"; const IMAGE = getImage(__dirname); describe("TimescaleContainer", { timeout: 180_000 }, () => { - it("should work", async () => { + it.concurrent("should work", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); const client = new Client({ @@ -24,7 +24,7 @@ describe("TimescaleContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should restart", async () => { + it.concurrent("should restart", async () => { const container = await new PostgreSqlContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/qdrant/src/qdrant-container.test.ts b/packages/modules/qdrant/src/qdrant-container.test.ts index 0908b5ee5..7d71a9e72 100644 --- a/packages/modules/qdrant/src/qdrant-container.test.ts +++ b/packages/modules/qdrant/src/qdrant-container.test.ts @@ -8,7 +8,7 @@ const IMAGE = getImage(__dirname); describe("QdrantContainer", { timeout: 100_000 }, () => { // connectQdrantSimple { - it("should connect to the client", async () => { + it.concurrent("should connect to the client", async () => { const container = await new QdrantContainer(IMAGE).start(); const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}` }); @@ -20,7 +20,7 @@ describe("QdrantContainer", { timeout: 100_000 }, () => { // } // connectQdrantWithApiKey { - it("should work with valid API keys", async () => { + it.concurrent("should work with valid API keys", async () => { const apiKey = crypto.randomUUID(); const container = await new QdrantContainer(IMAGE).withApiKey(apiKey).start(); @@ -33,7 +33,7 @@ describe("QdrantContainer", { timeout: 100_000 }, () => { }); // } - it("should fail for invalid API keys", async () => { + it.concurrent("should fail for invalid API keys", async () => { const apiKey = crypto.randomUUID(); const container = await new QdrantContainer(IMAGE).withApiKey(apiKey).start(); @@ -49,7 +49,7 @@ describe("QdrantContainer", { timeout: 100_000 }, () => { }); // connectQdrantWithConfig { - it("should work with config files - valid API key", async () => { + it.concurrent("should work with config files - valid API key", async () => { const container = await new QdrantContainer(IMAGE) .withConfigFile(path.resolve(__dirname, "test_config.yaml")) .start(); @@ -62,7 +62,7 @@ describe("QdrantContainer", { timeout: 100_000 }, () => { }); // } - it("should work with config files - invalid API key", async () => { + it.concurrent("should work with config files - invalid API key", async () => { const container = await new QdrantContainer(IMAGE) .withConfigFile(path.resolve(__dirname, "test_config.yaml")) .start(); diff --git a/packages/modules/rabbitmq/src/rabbitmq-container.test.ts b/packages/modules/rabbitmq/src/rabbitmq-container.test.ts index 51048cc23..d07050099 100644 --- a/packages/modules/rabbitmq/src/rabbitmq-container.test.ts +++ b/packages/modules/rabbitmq/src/rabbitmq-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("RabbitMQContainer", { timeout: 240_000 }, () => { // start { - it("should start, connect and close", async () => { + it.concurrent("should start, connect and close", async () => { const rabbitMQContainer = await new RabbitMQContainer(IMAGE).start(); const connection = await amqp.connect(rabbitMQContainer.getAmqpUrl()); @@ -17,7 +17,7 @@ describe("RabbitMQContainer", { timeout: 240_000 }, () => { // } // credentials { - it("different username and password", async () => { + it.concurrent("different username and password", async () => { const USER = "user"; const PASSWORD = "password"; @@ -41,29 +41,33 @@ describe("RabbitMQContainer", { timeout: 240_000 }, () => { // } // pubsub { - it("test publish and subscribe", async () => { - const QUEUE = "test"; - const PAYLOAD = "Hello World"; + it.concurrent( + "test publish and subscribe", + async () => { + const QUEUE = "test"; + const PAYLOAD = "Hello World"; - const rabbitMQContainer = await new RabbitMQContainer(IMAGE).start(); - const connection = await amqp.connect(rabbitMQContainer.getAmqpUrl()); + const rabbitMQContainer = await new RabbitMQContainer(IMAGE).start(); + const connection = await amqp.connect(rabbitMQContainer.getAmqpUrl()); - const channel = await connection.createChannel(); - await channel.assertQueue(QUEUE); + const channel = await connection.createChannel(); + await channel.assertQueue(QUEUE); - channel.sendToQueue(QUEUE, Buffer.from(PAYLOAD)); + channel.sendToQueue(QUEUE, Buffer.from(PAYLOAD)); - await new Promise((resolve) => { - channel.consume(QUEUE, (message) => { - expect(message?.content.toString()).toEqual(PAYLOAD); - resolve(true); + await new Promise((resolve) => { + channel.consume(QUEUE, (message) => { + expect(message?.content.toString()).toEqual(PAYLOAD); + resolve(true); + }); }); - }); - await channel.close(); - await connection.close(); + await channel.close(); + await connection.close(); - await rabbitMQContainer.stop(); - }, 20_000); + await rabbitMQContainer.stop(); + }, + 20_000 + ); // } }); diff --git a/packages/modules/redis/src/redis-container.test.ts b/packages/modules/redis/src/redis-container.test.ts index bb8df58a8..ba8d348f2 100644 --- a/packages/modules/redis/src/redis-container.test.ts +++ b/packages/modules/redis/src/redis-container.test.ts @@ -9,7 +9,7 @@ const IMAGE = getImage(__dirname); describe("RedisContainer", { timeout: 240_000 }, () => { // startContainer { - it("should connect and execute set-get", async () => { + it.concurrent("should connect and execute set-get", async () => { const container = await new RedisContainer(IMAGE).start(); const client = await connectTo(container); @@ -22,7 +22,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => { }); // } - it("should connect with password and execute set-get", async () => { + it.concurrent("should connect with password and execute set-get", async () => { const container = await new RedisContainer(IMAGE).withPassword("test").start(); const client = await connectTo(container); @@ -35,7 +35,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => { }); // persistentData { - it("should reconnect with volume and persistence data", async () => { + it.concurrent("should reconnect with volume and persistence data", async () => { const sourcePath = fs.mkdtempSync(path.join(os.tmpdir(), "redis-")); const container = await new RedisContainer(IMAGE).withPassword("test").withPersistence(sourcePath).start(); let client = await connectTo(container); @@ -58,7 +58,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => { // } // initial data import { - it("should load initial data and can read it", async () => { + it.concurrent("should load initial data and can read it", async () => { const container = await new RedisContainer(IMAGE) .withPassword("test") .withInitialData(path.join(__dirname, "initData.redis")) @@ -77,7 +77,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => { // } // startWithCredentials { - it("should start with credentials and login", async () => { + it.concurrent("should start with credentials and login", async () => { const password = "testPassword"; // Test authentication @@ -95,7 +95,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => { // } // executeCommand { - it("should execute container cmd and return the result", async () => { + it.concurrent("should execute container cmd and return the result", async () => { const container = await new RedisContainer(IMAGE).start(); const queryResult = await container.executeCliCmd("info", ["clients"]); @@ -106,7 +106,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => { // } // startWithRedisStack { - it("should start with redis-stack-server and json module", async () => { + it.concurrent("should start with redis-stack-server and json module", async () => { const container = await new RedisContainer("redis/redis-stack-server:7.4.0-v4") .withPassword("testPassword") .start(); diff --git a/packages/modules/redpanda/src/redpanda-container.test.ts b/packages/modules/redpanda/src/redpanda-container.test.ts index ab0621980..6b796b824 100644 --- a/packages/modules/redpanda/src/redpanda-container.test.ts +++ b/packages/modules/redpanda/src/redpanda-container.test.ts @@ -5,7 +5,7 @@ const IMAGE = getImage(__dirname); describe("RedpandaContainer", { timeout: 240_000 }, () => { // connectToKafka { - it("should connect", async () => { + it.concurrent("should connect", async () => { const redpandaContainer = await new RedpandaContainer(IMAGE).start(); await testPubSub(redpandaContainer); await redpandaContainer.stop(); @@ -13,7 +13,7 @@ describe("RedpandaContainer", { timeout: 240_000 }, () => { // } // connectToSchemaRegistry { - it("should connect to schema registry", async () => { + it.concurrent("should connect to schema registry", async () => { const redpandaContainer = await new RedpandaContainer(IMAGE).start(); const schemaRegistryUrl = redpandaContainer.getSchemaRegistryAddress(); @@ -31,7 +31,7 @@ describe("RedpandaContainer", { timeout: 240_000 }, () => { // } // connectToAdmin { - it("should connect to admin", async () => { + it.concurrent("should connect to admin", async () => { const redpandaContainer = await new RedpandaContainer(IMAGE).start(); const adminUrl = `${redpandaContainer.getAdminAddress()}/v1`; @@ -44,7 +44,7 @@ describe("RedpandaContainer", { timeout: 240_000 }, () => { // } // connectToRestProxy { - it("should connect to rest proxy", async () => { + it.concurrent("should connect to rest proxy", async () => { const redpandaContainer = await new RedpandaContainer(IMAGE).start(); const restProxyUrl = `${redpandaContainer.getRestProxyAddress()}/topics`; diff --git a/packages/modules/scylladb/src/scylladb-container.test.ts b/packages/modules/scylladb/src/scylladb-container.test.ts index 0b9d177f7..58fe52eb5 100644 --- a/packages/modules/scylladb/src/scylladb-container.test.ts +++ b/packages/modules/scylladb/src/scylladb-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("ScyllaDB", { timeout: 240_000 }, () => { // connectWithDefaultCredentials { - it("should connect and execute a query", async () => { + it.concurrent("should connect and execute a query", async () => { const container = await new ScyllaContainer(IMAGE).start(); const client = new Client({ @@ -26,7 +26,7 @@ describe("ScyllaDB", { timeout: 240_000 }, () => { // } // createAndFetchData { - it("should create keyspace, a table, insert data, and retrieve it", async () => { + it.concurrent("should create keyspace, a table, insert data, and retrieve it", async () => { const container = await new ScyllaContainer(IMAGE).start(); const client = new Client({ @@ -66,7 +66,7 @@ describe("ScyllaDB", { timeout: 240_000 }, () => { }); // } - it("should work with restarted container", async () => { + it.concurrent("should work with restarted container", async () => { const container = await new ScyllaContainer(IMAGE).start(); await container.restart(); diff --git a/packages/modules/toxiproxy/src/toxiproxy-container.test.ts b/packages/modules/toxiproxy/src/toxiproxy-container.test.ts index faa7bb2a6..b448de9a1 100644 --- a/packages/modules/toxiproxy/src/toxiproxy-container.test.ts +++ b/packages/modules/toxiproxy/src/toxiproxy-container.test.ts @@ -6,7 +6,7 @@ const IMAGE = getImage(__dirname); describe("ToxiProxyContainer", { timeout: 240_000 }, () => { // create_proxy { - it("should create a proxy to an endpoint", async () => { + it.concurrent("should create a proxy to an endpoint", async () => { const network = await new Network().start(); const appContainer = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -31,7 +31,7 @@ describe("ToxiProxyContainer", { timeout: 240_000 }, () => { // } // enabled_disabled { - it("should enable and disable a proxy", async () => { + it.concurrent("should enable and disable a proxy", async () => { const network = await new Network().start(); const appContainer = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -60,7 +60,7 @@ describe("ToxiProxyContainer", { timeout: 240_000 }, () => { // } // adding_toxic { - it("should add a toxic to a proxy and then remove", async () => { + it.concurrent("should add a toxic to a proxy and then remove", async () => { const network = await new Network().start(); const appContainer = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -100,7 +100,7 @@ describe("ToxiProxyContainer", { timeout: 240_000 }, () => { }); // } - it("should create multiple proxies", async () => { + it.concurrent("should create multiple proxies", async () => { const network = await new Network().start(); const appContainer = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -130,7 +130,7 @@ describe("ToxiProxyContainer", { timeout: 240_000 }, () => { await network.stop(); }); - it("throws an error when too many proxies are created", async () => { + it.concurrent("throws an error when too many proxies are created", async () => { const toxiproxyContainer = await new ToxiProxyContainer(IMAGE).start(); for (let i = 0; i < 32; i++) { diff --git a/packages/modules/valkey/src/valkey-container.test.ts b/packages/modules/valkey/src/valkey-container.test.ts index 12e642d68..3957e6df1 100644 --- a/packages/modules/valkey/src/valkey-container.test.ts +++ b/packages/modules/valkey/src/valkey-container.test.ts @@ -8,7 +8,7 @@ import { StartedValkeyContainer, ValkeyContainer } from "./valkey-container"; const IMAGE = getImage(__dirname); describe("ValkeyContainer", { timeout: 240_000 }, () => { - it("should connect and execute set-get", async () => { + it.concurrent("should connect and execute set-get", async () => { const container = await new ValkeyContainer(IMAGE).start(); const client = await connectTo(container); @@ -20,7 +20,7 @@ describe("ValkeyContainer", { timeout: 240_000 }, () => { await container.stop(); }); - it("should connect with password and execute set-get", async () => { + it.concurrent("should connect with password and execute set-get", async () => { const container = await new ValkeyContainer(IMAGE).withPassword("test").start(); const client = await connectTo(container); @@ -32,7 +32,7 @@ describe("ValkeyContainer", { timeout: 240_000 }, () => { await container.stop(); }); - it("should reconnect with volume and persistence data", async () => { + it.concurrent("should reconnect with volume and persistence data", async () => { const sourcePath = fs.mkdtempSync(path.join(os.tmpdir(), "valkey-")); const container = await new ValkeyContainer(IMAGE).withPassword("test").withPersistence(sourcePath).start(); let client = await connectTo(container); @@ -53,7 +53,7 @@ describe("ValkeyContainer", { timeout: 240_000 }, () => { } }); - it("should load initial data and can read it", async () => { + it.concurrent("should load initial data and can read it", async () => { const container = await new ValkeyContainer(IMAGE) .withPassword("test") .withInitialData(path.join(__dirname, "initData.valkey")) @@ -70,7 +70,7 @@ describe("ValkeyContainer", { timeout: 240_000 }, () => { await container.stop(); }); - it("should start with credentials and login", async () => { + it.concurrent("should start with credentials and login", async () => { const password = "testPassword"; const container = await new ValkeyContainer(IMAGE).withPassword(password).start(); @@ -85,7 +85,7 @@ describe("ValkeyContainer", { timeout: 240_000 }, () => { await container.stop(); }); - it("should execute container cmd and return the result", async () => { + it.concurrent("should execute container cmd and return the result", async () => { const container = await new ValkeyContainer(IMAGE).start(); const queryResult = await container.executeCliCmd("info", ["clients"]); diff --git a/packages/modules/weaviate/src/weaviate-container.test.ts b/packages/modules/weaviate/src/weaviate-container.test.ts index 1e31ffcad..af2ab3ac6 100644 --- a/packages/modules/weaviate/src/weaviate-container.test.ts +++ b/packages/modules/weaviate/src/weaviate-container.test.ts @@ -7,7 +7,7 @@ const IMAGE = getImage(__dirname); describe("WeaviateContainer", { timeout: 100_000 }, () => { // connectWeaviate { - it("should expose ports", async () => { + it.concurrent("should expose ports", async () => { const container = await new WeaviateContainer(IMAGE).start(); expect(container.getHttpHostAddress()).toBeDefined(); @@ -18,7 +18,7 @@ describe("WeaviateContainer", { timeout: 100_000 }, () => { // } // connectWeaviateWithClient { - it("should connect to Weaviate", async () => { + it.concurrent("should connect to Weaviate", async () => { const container = await new WeaviateContainer(IMAGE).start(); const client = weaviate.client({ @@ -34,7 +34,7 @@ describe("WeaviateContainer", { timeout: 100_000 }, () => { // } // connectWeaviateWithModules { - it("should connect to Weaviate with modules", async () => { + it.concurrent("should connect to Weaviate with modules", async () => { const enableModules = [ "backup-filesystem", "text2vec-openai", diff --git a/packages/testcontainers/src/common/hash.test.ts b/packages/testcontainers/src/common/hash.test.ts index 9a60dd330..e147250b6 100644 --- a/packages/testcontainers/src/common/hash.test.ts +++ b/packages/testcontainers/src/common/hash.test.ts @@ -1,6 +1,6 @@ import { hash } from "./hash"; -test("should return a consistent hash", () => { +test.concurrent("should return a consistent hash", () => { const str = "Hello, world!"; expect(hash(str)).toBe("315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3"); diff --git a/packages/testcontainers/src/common/retry.test.ts b/packages/testcontainers/src/common/retry.test.ts index 6674e7228..e0ea8e305 100644 --- a/packages/testcontainers/src/common/retry.test.ts +++ b/packages/testcontainers/src/common/retry.test.ts @@ -2,7 +2,7 @@ import { IntervalRetry } from "./retry"; describe("Retry", () => { describe("IntervalRetry", () => { - it("should not retry when predicate succeeds", async () => { + it.concurrent("should not retry when predicate succeeds", async () => { const fnMock = vi.fn().mockResolvedValue(true); const result = await new IntervalRetry(1).retryUntil( @@ -16,7 +16,7 @@ describe("Retry", () => { expect(fnMock).toHaveBeenCalledTimes(1); }); - it("should retry when predicate fails", async () => { + it.concurrent("should retry when predicate fails", async () => { const fnMock = vi.fn().mockResolvedValueOnce(false).mockResolvedValueOnce(true); const result = await new IntervalRetry(1).retryUntil( @@ -30,7 +30,7 @@ describe("Retry", () => { expect(fnMock).toHaveBeenCalledTimes(2); }); - it("should invoke timeout handler on timeout", async () => { + it.concurrent("should invoke timeout handler on timeout", async () => { const fnMock = vi.fn().mockResolvedValue(false); const timeoutMock = vi.fn().mockReturnValue(new Error()); diff --git a/packages/testcontainers/src/container-runtime/auth/auths.test.ts b/packages/testcontainers/src/container-runtime/auth/auths.test.ts index 71d531f45..a5ef089f8 100644 --- a/packages/testcontainers/src/container-runtime/auth/auths.test.ts +++ b/packages/testcontainers/src/container-runtime/auth/auths.test.ts @@ -5,17 +5,17 @@ describe("Auths", () => { const locator = new Auths(); describe("getAuthConfig", () => { - it("should return undefined when auths is undefined", async () => { + it.concurrent("should return undefined when auths is undefined", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = {}; expect(await locator.getAuthConfig("registry-name", containerRuntimeConfig)).toBeUndefined(); }); - it("should return undefined when auths does not contain registry name", async () => { + it.concurrent("should return undefined when auths does not contain registry name", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = { auths: {} }; expect(await locator.getAuthConfig("registry-name", containerRuntimeConfig)).toBeUndefined(); }); - it("should return credentials from username and password", async () => { + it.concurrent("should return credentials from username and password", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = { auths: { "https://registry.example.com": { @@ -34,7 +34,7 @@ describe("Auths", () => { expect(await locator.getAuthConfig("https://registry.example.com", containerRuntimeConfig)).toEqual(authConfig); }); - it("should not return credentials for registry which is a partial match", async () => { + it.concurrent("should not return credentials for registry which is a partial match", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = { auths: { "https://registry.example.com": { @@ -47,7 +47,7 @@ describe("Auths", () => { expect(await locator.getAuthConfig("registry.example.co", containerRuntimeConfig)).toBeUndefined(); }); - it("should return credentials from encoded auth", async () => { + it.concurrent("should return credentials from encoded auth", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = { auths: { "https://registry.example.com": { @@ -65,7 +65,7 @@ describe("Auths", () => { expect(await locator.getAuthConfig("https://registry.example.com", containerRuntimeConfig)).toEqual(authConfig); }); - it("should return credentials from encoded auth when the password contains a colon", async () => { + it.concurrent("should return credentials from encoded auth when the password contains a colon", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = { auths: { "https://registry.example.com": { diff --git a/packages/testcontainers/src/container-runtime/auth/cred-helpers.test.ts b/packages/testcontainers/src/container-runtime/auth/cred-helpers.test.ts index 0d7c21c51..bfec51595 100644 --- a/packages/testcontainers/src/container-runtime/auth/cred-helpers.test.ts +++ b/packages/testcontainers/src/container-runtime/auth/cred-helpers.test.ts @@ -5,7 +5,7 @@ describe("CredHelpers", () => { const locator = new CredHelpers(); describe("getAuthConfig", () => { - it("should return undefined when config does not contain cred helpers", async () => { + it.concurrent("should return undefined when config does not contain cred helpers", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = {}; expect(await locator.getAuthConfig("registry-name", containerRuntimeConfig)).toBe(undefined); }); diff --git a/packages/testcontainers/src/container-runtime/auth/credential-provider.test.ts b/packages/testcontainers/src/container-runtime/auth/credential-provider.test.ts index b84f1e99b..14f90c861 100644 --- a/packages/testcontainers/src/container-runtime/auth/credential-provider.test.ts +++ b/packages/testcontainers/src/container-runtime/auth/credential-provider.test.ts @@ -20,7 +20,7 @@ describe("CredentialProvider", () => { containerRuntimeConfig = {}; }); - it("should return the auth config for a registry", async () => { + it.concurrent("should return the auth config for a registry", async () => { mockExecReturns(JSON.stringify({ registry: "username" })); mockSpawnReturns( 0, @@ -40,7 +40,7 @@ describe("CredentialProvider", () => { }); }); - it("should not return auth config for registry which is a partial match", async () => { + it.concurrent("should not return auth config for registry which is a partial match", async () => { mockExecReturns(JSON.stringify({ "https://registry.example.com": "username" })); mockSpawnReturns( 0, @@ -56,7 +56,7 @@ describe("CredentialProvider", () => { ).toBeUndefined(); }); - it("should default to the registry url when the server url is not returned", async () => { + it.concurrent("should default to the registry url when the server url is not returned", async () => { mockExecReturns(JSON.stringify({ "https://registry.example.com": "username" })); mockSpawnReturns( 0, @@ -73,7 +73,7 @@ describe("CredentialProvider", () => { }); }); - it("should return undefined when no auth config found for registry", async () => { + it.concurrent("should return undefined when no auth config found for registry", async () => { mockExecReturns(JSON.stringify({ registry2: "username" })); const credentials = await credentialProvider.getAuthConfig("registry1", containerRuntimeConfig); @@ -81,13 +81,13 @@ describe("CredentialProvider", () => { expect(credentials).toBeUndefined(); }); - it("should return undefined when provider name not provided", async () => { + it.concurrent("should return undefined when provider name not provided", async () => { const credentialProvider = new TestCredentialProvider("name", undefined!); expect(await credentialProvider.getAuthConfig("registry", containerRuntimeConfig)).toBeUndefined(); }); - it("should throw when list credentials fails", async () => { + it.concurrent("should throw when list credentials fails", async () => { mockExecThrows(); await expect(() => credentialProvider.getAuthConfig("registry", containerRuntimeConfig)).rejects.toThrow( @@ -95,7 +95,7 @@ describe("CredentialProvider", () => { ); }); - it("should throw when list credentials output cannot be parsed", async () => { + it.concurrent("should throw when list credentials output cannot be parsed", async () => { mockExecReturns("CANNOT_PARSE"); await expect(() => credentialProvider.getAuthConfig("registry", containerRuntimeConfig)).rejects.toThrow( @@ -103,7 +103,7 @@ describe("CredentialProvider", () => { ); }); - it("should not throw when list credentials command is not implemented", async () => { + it.concurrent("should not throw when list credentials command is not implemented", async () => { mockExec.mockImplementationOnce((command, callback) => { return callback(new Error(), null, "list is unimplemented\n"); }); @@ -113,7 +113,7 @@ describe("CredentialProvider", () => { expect(credentials).toBeUndefined(); }); - it("should throw when get credentials fails", async () => { + it.concurrent("should throw when get credentials fails", async () => { mockExecReturns(JSON.stringify({ registry: "username" })); mockSpawnReturns( 1, @@ -129,7 +129,7 @@ describe("CredentialProvider", () => { ); }); - it("should throw when get credentials output cannot be parsed", async () => { + it.concurrent("should throw when get credentials output cannot be parsed", async () => { mockExecReturns(JSON.stringify({ registry: "username" })); mockSpawnReturns(0, "CANNOT_PARSE"); diff --git a/packages/testcontainers/src/container-runtime/auth/creds-store.test.ts b/packages/testcontainers/src/container-runtime/auth/creds-store.test.ts index 75ce0c638..fd9202508 100644 --- a/packages/testcontainers/src/container-runtime/auth/creds-store.test.ts +++ b/packages/testcontainers/src/container-runtime/auth/creds-store.test.ts @@ -5,12 +5,12 @@ describe("CredsStore", () => { const locator = new CredsStore(); describe("getAuthConfig", () => { - it("should return undefined when config does not contain creds store", async () => { + it.concurrent("should return undefined when config does not contain creds store", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = {}; expect(await locator.getAuthConfig("registry-name", containerRuntimeConfig)).toBe(undefined); }); - it("should return undefined when when creds store is empty", async () => { + it.concurrent("should return undefined when when creds store is empty", async () => { const containerRuntimeConfig: ContainerRuntimeConfig = { credsStore: "" }; expect(await locator.getAuthConfig("registry-name", containerRuntimeConfig)).toBe(undefined); }); diff --git a/packages/testcontainers/src/container-runtime/auth/get-auth-config.test.ts b/packages/testcontainers/src/container-runtime/auth/get-auth-config.test.ts index bb9e8887d..4ad8a7a24 100644 --- a/packages/testcontainers/src/container-runtime/auth/get-auth-config.test.ts +++ b/packages/testcontainers/src/container-runtime/auth/get-auth-config.test.ts @@ -17,7 +17,7 @@ describe("get auth config", () => { vi.resetModules(); }); - it("should use DOCKER_AUTH_CONFIG environment variable as Docker config", async () => { + it.concurrent("should use DOCKER_AUTH_CONFIG environment variable as Docker config", async () => { vi.stubEnv( "DOCKER_AUTH_CONFIG", JSON.stringify({ @@ -39,7 +39,7 @@ describe("get auth config", () => { }); }); - it("should return auth from docker config file", async () => { + it.concurrent("should return auth from docker config file", async () => { mockExistsSync.mockReturnValue(true); mockReadFile.mockResolvedValue( Buffer.from( @@ -63,7 +63,7 @@ describe("get auth config", () => { }); }); - it("should return empty auth when docker config file does not exist", async () => { + it.concurrent("should return empty auth when docker config file does not exist", async () => { mockExistsSync.mockReturnValue(false); const { getAuthConfig } = await import("./get-auth-config"); expect(await getAuthConfig("https://registry.example.com")).toBeUndefined(); diff --git a/packages/testcontainers/src/container-runtime/auth/registry-matches.test.ts b/packages/testcontainers/src/container-runtime/auth/registry-matches.test.ts index 2b4b1cdcf..6e8de7c03 100644 --- a/packages/testcontainers/src/container-runtime/auth/registry-matches.test.ts +++ b/packages/testcontainers/src/container-runtime/auth/registry-matches.test.ts @@ -1,15 +1,15 @@ import { registryMatches } from "./registry-matches"; describe("registryMatches", () => { - it("should return true when registries are equal", () => { + it.concurrent("should return true when registries are equal", () => { expect(registryMatches("https://registry.example.com", "https://registry.example.com")).toBe(true); }); - it("should return true when registries are equal without protocol", () => { + it.concurrent("should return true when registries are equal without protocol", () => { expect(registryMatches("https://registry.example.com", "registry.example.com")).toBe(true); }); - it("should return false when registries do not match", () => { + it.concurrent("should return false when registries do not match", () => { expect(registryMatches("https://registry.example.com", "registry.example.co")).toBe(false); }); }); diff --git a/packages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.test.ts b/packages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.test.ts index 703a3e05b..d43527476 100644 --- a/packages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.test.ts +++ b/packages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.test.ts @@ -1,21 +1,21 @@ import { parseComposeContainerName } from "./parse-compose-container-name"; describe("parseComposeContainerName", () => { - it("should remove project name label", () => { + it.concurrent("should remove project name label", () => { const name = "/project-name_container_1"; const expected = "container_1"; expect(parseComposeContainerName("project-name", name)).toBe(expected); }); - it("should resolve explicit container name", () => { + it.concurrent("should resolve explicit container name", () => { const name = "/custom-container"; const expected = "custom-container"; expect(parseComposeContainerName("project-name", name)).toBe(expected); }); - it("should throw error if unable to resolve container name", () => { + it.concurrent("should throw error if unable to resolve container name", () => { expect(() => parseComposeContainerName("project-name", "container_1")).toThrowError( `Unable to resolve container name for container name: "container_1", project name: "project-name"` ); diff --git a/packages/testcontainers/src/container-runtime/image-name.test.ts b/packages/testcontainers/src/container-runtime/image-name.test.ts index 4f87519cc..5c674eb54 100644 --- a/packages/testcontainers/src/container-runtime/image-name.test.ts +++ b/packages/testcontainers/src/container-runtime/image-name.test.ts @@ -1,7 +1,7 @@ import { ImageName } from "./image-name"; describe("ContainerImage", () => { - it("should return whether two image names are equal", () => { + it.concurrent("should return whether two image names are equal", () => { const imageName = new ImageName("registry", "image", "tag"); expect(imageName.equals(new ImageName("registry", "image", "tag"))).toBe(true); @@ -11,27 +11,27 @@ describe("ContainerImage", () => { }); describe("string", () => { - it("should work with registry", () => { + it.concurrent("should work with registry", () => { const imageName = new ImageName("registry", "image", "tag"); expect(imageName.string).toBe("registry/image:tag"); }); - it("should work without registry", () => { + it.concurrent("should work without registry", () => { const imageName = new ImageName(undefined, "image", "tag"); expect(imageName.string).toBe("image:tag"); }); - it("should work with tag being a hash", () => { + it.concurrent("should work with tag being a hash", () => { const imageName = new ImageName(undefined, "image", "sha256:1234abcd1234abcd1234abcd1234abcd"); expect(imageName.string).toBe("image@sha256:1234abcd1234abcd1234abcd1234abcd"); }); - it("should work with registry and tag being a hash", () => { + it.concurrent("should work with registry and tag being a hash", () => { const imageName = new ImageName("registry", "image", "sha256:1234abcd1234abcd1234abcd1234abcd"); expect(imageName.string).toBe("registry/image@sha256:1234abcd1234abcd1234abcd1234abcd"); }); - it("should not append the `latest` tag to image IDs", () => { + it.concurrent("should not append the `latest` tag to image IDs", () => { const imageName = new ImageName( undefined, "aa285b773a2c042056883845aea893a743d358a5d40f61734fa228fde93dae6f", @@ -40,7 +40,7 @@ describe("ContainerImage", () => { expect(imageName.string).toBe("aa285b773a2c042056883845aea893a743d358a5d40f61734fa228fde93dae6f"); }); - it("should keep other tags (not `latest`) on image IDs", () => { + it.concurrent("should keep other tags (not `latest`) on image IDs", () => { // Note that the resulting image ID will not be accepted by Docker: // // > "invalid repository name [...], cannot specify 64-byte hexadecimal strings" @@ -68,7 +68,7 @@ describe("ContainerImage", () => { }); describe("fromString", () => { - it("should work", () => { + it.concurrent("should work", () => { const imageName = ImageName.fromString("image:latest"); expect(imageName.registry).toBeUndefined(); @@ -76,7 +76,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work without tag", () => { + it.concurrent("should work without tag", () => { const imageName = ImageName.fromString("image"); expect(imageName.registry).toBeUndefined(); @@ -84,7 +84,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry", () => { + it.concurrent("should work with registry", () => { const imageName = ImageName.fromString("domain.com/image:latest"); expect(imageName.registry).toBe("domain.com"); @@ -92,7 +92,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry with port", () => { + it.concurrent("should work with registry with port", () => { const imageName = ImageName.fromString("domain.com:5000/image:latest"); expect(imageName.registry).toBe("domain.com:5000"); @@ -100,7 +100,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry without tag", () => { + it.concurrent("should work with registry without tag", () => { const imageName = ImageName.fromString("domain.com/image"); expect(imageName.registry).toBe("domain.com"); @@ -108,7 +108,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with nested image", () => { + it.concurrent("should work with nested image", () => { const imageName = ImageName.fromString("parent/child:latest"); expect(imageName.registry).toBe(undefined); @@ -116,7 +116,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry and nested image", () => { + it.concurrent("should work with registry and nested image", () => { const imageName = ImageName.fromString("domain.com/parent/child:latest"); expect(imageName.registry).toBe("domain.com"); @@ -124,7 +124,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with tag being a hash", () => { + it.concurrent("should work with tag being a hash", () => { const imageName = ImageName.fromString("image@sha256:1234abcd1234abcd1234abcd1234abcd"); expect(imageName.registry).toBe(undefined); @@ -132,7 +132,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("sha256:1234abcd1234abcd1234abcd1234abcd"); }); - it("should work with image being an image ID", () => { + it.concurrent("should work with image being an image ID", () => { const imageName = ImageName.fromString("aa285b773a2c042056883845aea893a743d358a5d40f61734fa228fde93dae6f"); expect(imageName.registry).toBe(undefined); @@ -140,7 +140,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with image being an image ID and an explicit tag", () => { + it.concurrent("should work with image being an image ID and an explicit tag", () => { // Note: Such an ID will not be accepted by docker: // // > "invalid repository name [...], cannot specify 64-byte hexadecimal strings" @@ -171,7 +171,7 @@ describe("ContainerImage", () => { vi.stubEnv("TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX", customRegistry); }); - it("should work", () => { + it.concurrent("should work", () => { const imageName = ImageName.fromString("image:latest"); expect(imageName.registry).toEqual(expectedRegistry); @@ -179,7 +179,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work without tag", () => { + it.concurrent("should work without tag", () => { const imageName = ImageName.fromString("image"); expect(imageName.registry).toEqual(expectedRegistry); @@ -187,7 +187,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry", () => { + it.concurrent("should work with registry", () => { const imageName = ImageName.fromString("domain.com/image:latest"); expect(imageName.registry).toBe("domain.com"); @@ -195,7 +195,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry with port", () => { + it.concurrent("should work with registry with port", () => { const imageName = ImageName.fromString("domain.com:5000/image:latest"); expect(imageName.registry).toBe("domain.com:5000"); @@ -203,7 +203,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry without tag", () => { + it.concurrent("should work with registry without tag", () => { const imageName = ImageName.fromString("domain.com/image"); expect(imageName.registry).toBe("domain.com"); @@ -211,7 +211,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with nested image", () => { + it.concurrent("should work with nested image", () => { const imageName = ImageName.fromString("parent/child:latest"); expect(imageName.registry).toEqual(expectedRegistry); @@ -219,7 +219,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with registry and nested image", () => { + it.concurrent("should work with registry and nested image", () => { const imageName = ImageName.fromString("domain.com/parent/child:latest"); expect(imageName.registry).toBe("domain.com"); @@ -227,7 +227,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with tag being a hash", () => { + it.concurrent("should work with tag being a hash", () => { const imageName = ImageName.fromString("image@sha256:1234abcd1234abcd1234abcd1234abcd"); expect(imageName.registry).toEqual(expectedRegistry); @@ -235,7 +235,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("sha256:1234abcd1234abcd1234abcd1234abcd"); }); - it("should work with image being an image ID", () => { + it.concurrent("should work with image being an image ID", () => { const imageName = ImageName.fromString("aa285b773a2c042056883845aea893a743d358a5d40f61734fa228fde93dae6f"); expect(imageName.registry).toEqual(expectedRegistry); @@ -245,7 +245,7 @@ describe("ContainerImage", () => { expect(imageName.tag).toBe("latest"); }); - it("should work with image being an image ID and an explicit tag", () => { + it.concurrent("should work with image being an image ID and an explicit tag", () => { // Note: Such an ID will not be accepted by docker: // // > "invalid repository name [...], cannot specify 64-byte hexadecimal strings" diff --git a/packages/testcontainers/src/container-runtime/strategies/configuration-strategy.test.ts b/packages/testcontainers/src/container-runtime/strategies/configuration-strategy.test.ts index c7f027c9b..a380182c3 100644 --- a/packages/testcontainers/src/container-runtime/strategies/configuration-strategy.test.ts +++ b/packages/testcontainers/src/container-runtime/strategies/configuration-strategy.test.ts @@ -9,7 +9,7 @@ const mockGetContainerRuntimeConfig = vi.mocked(getContainerRuntimeConfig); const mockReadFile = vi.mocked(readFile); describe("ConfigurationStrategy", () => { - it("should return undefined if no docker host is set", async () => { + it.concurrent("should return undefined if no docker host is set", async () => { mockGetContainerRuntimeConfig.mockResolvedValueOnce({ dockerHost: undefined }); const result = await new ConfigurationStrategy().getResult(); @@ -17,7 +17,7 @@ describe("ConfigurationStrategy", () => { expect(result).toBeUndefined(); }); - it("should set host and port when docker host is a URL", async () => { + it.concurrent("should set host and port when docker host is a URL", async () => { mockGetContainerRuntimeConfig.mockResolvedValueOnce({ dockerHost: "tcp://docker:8025" }); const result = await new ConfigurationStrategy().getResult(); @@ -36,7 +36,7 @@ describe("ConfigurationStrategy", () => { ); }); - it("should set socket path when docker host is a path", async () => { + it.concurrent("should set socket path when docker host is a path", async () => { mockGetContainerRuntimeConfig.mockResolvedValueOnce({ dockerHost: "unix:///var/run/docker.sock" }); const result = await new ConfigurationStrategy().getResult(); @@ -54,7 +54,7 @@ describe("ConfigurationStrategy", () => { ); }); - it("should allow user overrides", async () => { + it.concurrent("should allow user overrides", async () => { mockGetContainerRuntimeConfig.mockResolvedValueOnce({ dockerHost: "tcp://docker:8025" }); const result = await new ConfigurationStrategy().getResult(); @@ -62,7 +62,7 @@ describe("ConfigurationStrategy", () => { expect(result?.allowUserOverrides).toEqual(true); }); - it("should set SSL options when TLS is enabled", async () => { + it.concurrent("should set SSL options when TLS is enabled", async () => { mockGetContainerRuntimeConfig.mockResolvedValueOnce({ dockerHost: "tcp://docker:8025", dockerTlsVerify: "1", diff --git a/packages/testcontainers/src/container-runtime/strategies/npipe-socket-strategy.test.ts b/packages/testcontainers/src/container-runtime/strategies/npipe-socket-strategy.test.ts index d4240f7fa..a5a8560ec 100644 --- a/packages/testcontainers/src/container-runtime/strategies/npipe-socket-strategy.test.ts +++ b/packages/testcontainers/src/container-runtime/strategies/npipe-socket-strategy.test.ts @@ -1,12 +1,12 @@ import { NpipeSocketStrategy } from "./npipe-socket-strategy"; describe("NpipeSocketStrategy", () => { - it("should return undefined when platform is not win32", async () => { + it.concurrent("should return undefined when platform is not win32", async () => { const result = await new NpipeSocketStrategy("linux").getResult(); expect(result).toBeUndefined(); }); - it("should return expected result", async () => { + it.concurrent("should return expected result", async () => { const result = await new NpipeSocketStrategy("win32").getResult(); expect(result?.uri).toEqual("npipe:////./pipe/docker_engine"); diff --git a/packages/testcontainers/src/container-runtime/strategies/rootless-unix-socket-strategy.test.ts b/packages/testcontainers/src/container-runtime/strategies/rootless-unix-socket-strategy.test.ts index 6f84e5225..1eb54f114 100644 --- a/packages/testcontainers/src/container-runtime/strategies/rootless-unix-socket-strategy.test.ts +++ b/packages/testcontainers/src/container-runtime/strategies/rootless-unix-socket-strategy.test.ts @@ -8,7 +8,7 @@ vi.mock("fs", () => ({ existsSync: vi.fn() })); describe("RootlessUnixSocketStrategy", () => { const mockExistsSync = vi.mocked(existsSync); - it("should return undefined for non-linux and non-darwin platforms", async () => { + it.concurrent("should return undefined for non-linux and non-darwin platforms", async () => { mockExistsSync.mockReturnValue(true); const strategy = new RootlessUnixSocketStrategy("win32", {}); @@ -17,7 +17,7 @@ describe("RootlessUnixSocketStrategy", () => { expect(result).toBeUndefined(); }); - it("should return undefined when socket does not exist", async () => { + it.concurrent("should return undefined when socket does not exist", async () => { mockExistsSync.mockReturnValue(false); const strategy = new RootlessUnixSocketStrategy("linux", {}); @@ -26,7 +26,7 @@ describe("RootlessUnixSocketStrategy", () => { expect(result).toBeUndefined(); }); - it("should return client for socket from XDG_RUNTIME_DIR", async () => { + it.concurrent("should return client for socket from XDG_RUNTIME_DIR", async () => { const socketPath = path.join("/tmp", "docker.sock"); mockExistsSync.mockImplementation((file) => file === socketPath); @@ -36,7 +36,7 @@ describe("RootlessUnixSocketStrategy", () => { expect(result?.uri).toEqual(`unix://${socketPath}`); }); - it("should return client for socket from home run dir", async () => { + it.concurrent("should return client for socket from home run dir", async () => { const socketPath = path.join(os.homedir(), ".docker", "run", "docker.sock"); mockExistsSync.mockImplementation((file) => file === socketPath); @@ -46,7 +46,7 @@ describe("RootlessUnixSocketStrategy", () => { expect(result?.uri).toEqual(`unix://${socketPath}`); }); - it("should return Docker client for socket from home desktop dir", async () => { + it.concurrent("should return Docker client for socket from home desktop dir", async () => { const socketPath = path.join(os.homedir(), ".docker", "desktop", "docker.sock"); mockExistsSync.mockImplementation((file) => file === socketPath); @@ -56,7 +56,7 @@ describe("RootlessUnixSocketStrategy", () => { expect(result?.uri).toEqual(`unix://${socketPath}`); }); - it("should return Docker client for socket from run dir", async () => { + it.concurrent("should return Docker client for socket from run dir", async () => { const socketPath = path.join("/run", "user", `${os.userInfo().uid}`, "docker.sock"); mockExistsSync.mockImplementation((file) => file === socketPath); diff --git a/packages/testcontainers/src/container-runtime/strategies/testcontainers-host-strategy.test.ts b/packages/testcontainers/src/container-runtime/strategies/testcontainers-host-strategy.test.ts index 4c499320c..de9027380 100644 --- a/packages/testcontainers/src/container-runtime/strategies/testcontainers-host-strategy.test.ts +++ b/packages/testcontainers/src/container-runtime/strategies/testcontainers-host-strategy.test.ts @@ -6,7 +6,7 @@ vi.mock("./utils/config", () => ({ })); describe("TestcontainersHostStrategy", () => { - it("should return undefined when tc.host property is not set", async () => { + it.concurrent("should return undefined when tc.host property is not set", async () => { mockGetContainerRuntimeConfig.mockResolvedValue({}); const strategy = new TestcontainersHostStrategy(); @@ -15,7 +15,7 @@ describe("TestcontainersHostStrategy", () => { expect(result).toBeUndefined(); }); - it("should be defined when tc.host property is set", async () => { + it.concurrent("should be defined when tc.host property is set", async () => { mockGetContainerRuntimeConfig.mockResolvedValue({ tcHost: "tcp://tc:2375" }); const strategy = new TestcontainersHostStrategy(); @@ -24,7 +24,7 @@ describe("TestcontainersHostStrategy", () => { expect(result).toBeDefined(); }); - it("should return relevant fields", async () => { + it.concurrent("should return relevant fields", async () => { mockGetContainerRuntimeConfig.mockResolvedValue({ tcHost: "tcp://tc:2375" }); const strategy = new TestcontainersHostStrategy(); diff --git a/packages/testcontainers/src/container-runtime/strategies/unix-socket-strategy.test.ts b/packages/testcontainers/src/container-runtime/strategies/unix-socket-strategy.test.ts index d18c5faca..241908a82 100644 --- a/packages/testcontainers/src/container-runtime/strategies/unix-socket-strategy.test.ts +++ b/packages/testcontainers/src/container-runtime/strategies/unix-socket-strategy.test.ts @@ -9,12 +9,12 @@ describe("UnixSocketStrategy", () => { mockExistsSync.mockReturnValue(true); }); - it("should return undefined when platform is not linux or darwin", async () => { + it.concurrent("should return undefined when platform is not linux or darwin", async () => { const result = await new UnixSocketStrategy("win32").getResult(); expect(result).toBeUndefined(); }); - it("should return undefined when platform is correct but socket does not exist", async () => { + it.concurrent("should return undefined when platform is correct but socket does not exist", async () => { mockExistsSync.mockReturnValue(false); const result = await new UnixSocketStrategy("linux").getResult(); @@ -22,7 +22,7 @@ describe("UnixSocketStrategy", () => { expect(result).toBeUndefined(); }); - it("should return expected result", async () => { + it.concurrent("should return expected result", async () => { const result = await new UnixSocketStrategy("linux").getResult(); expect(result?.uri).toEqual("unix:///var/run/docker.sock"); diff --git a/packages/testcontainers/src/container-runtime/strategies/utils/config.test.ts b/packages/testcontainers/src/container-runtime/strategies/utils/config.test.ts index 07d0eb33f..2ea3f8b4d 100644 --- a/packages/testcontainers/src/container-runtime/strategies/utils/config.test.ts +++ b/packages/testcontainers/src/container-runtime/strategies/utils/config.test.ts @@ -15,7 +15,7 @@ afterEach(() => { vi.resetModules(); }); -test("should not set anything", async () => { +test.concurrent("should not set anything", async () => { const dockerClientConfig = await getContainerRuntimeConfig({}); expect(dockerClientConfig.dockerHost).toBeUndefined(); @@ -28,7 +28,7 @@ describe("environment", () => { mockExistsSync.mockReturnValue(false); }); - test("should set the host", async () => { + test.concurrent("should set the host", async () => { const dockerClientConfig = await getContainerRuntimeConfig({ DOCKER_HOST: "tcp://my.docker.host:1234", }); @@ -38,7 +38,7 @@ describe("environment", () => { expect(dockerClientConfig.dockerCertPath).toBeUndefined(); }); - test("should set TLS verify", async () => { + test.concurrent("should set TLS verify", async () => { const dockerClientConfig = await getContainerRuntimeConfig({ DOCKER_HOST: "tcp://my.docker.host:1234", DOCKER_TLS_VERIFY: "1", @@ -49,7 +49,7 @@ describe("environment", () => { expect(dockerClientConfig.dockerCertPath).toBeUndefined(); }); - test("should set the cert path", async () => { + test.concurrent("should set the cert path", async () => { const dockerClientConfig = await getContainerRuntimeConfig({ DOCKER_HOST: "tcp://my.docker.host:1234", DOCKER_TLS_VERIFY: "1", @@ -67,7 +67,7 @@ describe("testcontainers.properties file", () => { mockExistsSync.mockReturnValue(true); }); - test("should set the tc host", async () => { + test.concurrent("should set the tc host", async () => { mockReadFile.mockResolvedValueOnce("tc.host=tcp://my.docker.host:1234"); const dockerClientConfig = await getContainerRuntimeConfig({}); @@ -75,7 +75,7 @@ describe("testcontainers.properties file", () => { expect(dockerClientConfig.tcHost).toBe("tcp://my.docker.host:1234"); }); - test("should set the host", async () => { + test.concurrent("should set the host", async () => { mockReadFile.mockResolvedValueOnce("docker.host=tcp://my.docker.host:1234"); const dockerClientConfig = await getContainerRuntimeConfig({}); @@ -85,7 +85,7 @@ describe("testcontainers.properties file", () => { expect(dockerClientConfig.dockerCertPath).toBeUndefined(); }); - test("should set TLS verify", async () => { + test.concurrent("should set TLS verify", async () => { mockReadFile.mockResolvedValueOnce(` docker.host=tcp://my.docker.host:1234 docker.tls.verify=1 @@ -98,7 +98,7 @@ describe("testcontainers.properties file", () => { expect(dockerClientConfig.dockerCertPath).toBeUndefined(); }); - test("should set the cert path", async () => { + test.concurrent("should set the cert path", async () => { mockReadFile.mockResolvedValueOnce(` docker.host=tcp://my.docker.host:1234 docker.tls.verify=1 @@ -113,7 +113,7 @@ describe("testcontainers.properties file", () => { }); }); -test("should cache the result", async () => { +test.concurrent("should cache the result", async () => { mockExistsSync.mockReturnValue(true); mockReadFile.mockResolvedValueOnce("tc.host=tcp://my.docker.host:1234"); diff --git a/packages/testcontainers/src/container-runtime/utils/image-exists.test.ts b/packages/testcontainers/src/container-runtime/utils/image-exists.test.ts index d9743fa15..3a33ffe36 100644 --- a/packages/testcontainers/src/container-runtime/utils/image-exists.test.ts +++ b/packages/testcontainers/src/container-runtime/utils/image-exists.test.ts @@ -16,7 +16,7 @@ afterEach(() => { vi.resetModules(); }); -test("returns true when image exists", async () => { +test.concurrent("returns true when image exists", async () => { const { imageExists } = await import("./image-exists"); mockImageInspect.mockResolvedValue({}); @@ -26,7 +26,7 @@ test("returns true when image exists", async () => { expect(result).toBe(true); }); -test("returns previous result from cache", async () => { +test.concurrent("returns previous result from cache", async () => { const { imageExists } = await import("./image-exists"); mockImageInspect.mockResolvedValue({}); @@ -38,7 +38,7 @@ test("returns previous result from cache", async () => { expect(mockImageInspect).toHaveBeenCalledTimes(1); }); -test("returns false when image inspect fails because image does not exist", async () => { +test.concurrent("returns false when image inspect fails because image does not exist", async () => { const { imageExists } = await import("./image-exists"); mockImageInspect.mockRejectedValue(new Error("no such image")); @@ -48,7 +48,7 @@ test("returns false when image inspect fails because image does not exist", asyn expect(result).toBe(false); }); -test("throws when unable to inspect image", async () => { +test.concurrent("throws when unable to inspect image", async () => { const { imageExists } = await import("./image-exists"); mockImageInspect.mockRejectedValue(new Error("unknown error")); diff --git a/packages/testcontainers/src/container-runtime/utils/lookup-host-ips.test.ts b/packages/testcontainers/src/container-runtime/utils/lookup-host-ips.test.ts index ef56a59b1..8cd939f69 100644 --- a/packages/testcontainers/src/container-runtime/utils/lookup-host-ips.test.ts +++ b/packages/testcontainers/src/container-runtime/utils/lookup-host-ips.test.ts @@ -9,18 +9,18 @@ vi.mock("dns/promises", () => { }); describe("lookupHostIps", () => { - it("should return a list of resolved host IPs when host is not an IP", async () => { + it.concurrent("should return a list of resolved host IPs when host is not an IP", async () => { const hostIps: HostIp[] = [{ address: "127.0.0.1", family: 4 }]; mockDnsLookup.mockResolvedValueOnce(hostIps); expect(await lookupHostIps("localhost")).toEqual(hostIps); }); - it("should return host IP and v4 family when host is an IPv4 IP", async () => { + it.concurrent("should return host IP and v4 family when host is an IPv4 IP", async () => { expect(await lookupHostIps("127.0.0.1")).toEqual([{ address: "127.0.0.1", family: 4 }]); expect(mockDnsLookup).not.toHaveBeenCalled(); }); - it("should return host IP and v6 family when host is an IPv6 IP", async () => { + it.concurrent("should return host IP and v6 family when host is an IPv6 IP", async () => { expect(await lookupHostIps("::1")).toEqual([{ address: "::1", family: 6 }]); expect(mockDnsLookup).not.toHaveBeenCalled(); }); diff --git a/packages/testcontainers/src/container-runtime/utils/remote-container-runtime-socket-path.test.ts b/packages/testcontainers/src/container-runtime/utils/remote-container-runtime-socket-path.test.ts index e482219c2..677276432 100644 --- a/packages/testcontainers/src/container-runtime/utils/remote-container-runtime-socket-path.test.ts +++ b/packages/testcontainers/src/container-runtime/utils/remote-container-runtime-socket-path.test.ts @@ -1,7 +1,7 @@ import { ContainerRuntimeClientStrategyResult } from "../strategies/types"; import { getRemoteContainerRuntimeSocketPath } from "./remote-container-runtime-socket-path"; -test("should return TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE when provided", () => { +test.concurrent("should return TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE when provided", () => { const strategyResult = { uri: "unix:///var/run/docker.sock", allowUserOverrides: true, @@ -14,7 +14,7 @@ test("should return TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE when provided", () => expect(actual).toEqual("/var/run/another.sock"); }); -test("should return /var/run/docker.sock on Docker Desktop", () => { +test.concurrent("should return /var/run/docker.sock on Docker Desktop", () => { const strategyResult = { uri: "unix:///var/run/docker.sock", allowUserOverrides: true, @@ -25,7 +25,7 @@ test("should return /var/run/docker.sock on Docker Desktop", () => { expect(actual).toEqual("/var/run/docker.sock"); }); -test("should return /var/run/docker.sock when URI is not a unix socket", () => { +test.concurrent("should return /var/run/docker.sock when URI is not a unix socket", () => { ["tcp://localhost:2375", "npipe:////./pipe/docker_engine"].forEach((uri) => { const strategyResult = { uri, allowUserOverrides: true } as ContainerRuntimeClientStrategyResult; @@ -35,7 +35,7 @@ test("should return /var/run/docker.sock when URI is not a unix socket", () => { }); }); -test("should not return TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE when allow user override is false", () => { +test.concurrent("should not return TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE when allow user override is false", () => { const containerRuntimeStrategyResult = { uri: "unix:///var/run/docker.sock", allowUserOverrides: false, @@ -48,7 +48,7 @@ test("should not return TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE when allow user ov expect(actual).toEqual("/var/run/docker.sock"); }); -test("should return path of a unix socket", () => { +test.concurrent("should return path of a unix socket", () => { const strategyResult = { uri: "unix:///var/run/docker.sock", allowUserOverrides: true, @@ -59,7 +59,7 @@ test("should return path of a unix socket", () => { expect(actual).toEqual("/var/run/docker.sock"); }); -test("should prepend / to follow the UNC for Windows", () => { +test.concurrent("should prepend / to follow the UNC for Windows", () => { const strategyResult = { uri: "unix:///var/run/docker.sock", allowUserOverrides: true, diff --git a/packages/testcontainers/src/container-runtime/utils/resolve-host.test.ts b/packages/testcontainers/src/container-runtime/utils/resolve-host.test.ts index b2c029363..fda907ac6 100644 --- a/packages/testcontainers/src/container-runtime/utils/resolve-host.test.ts +++ b/packages/testcontainers/src/container-runtime/utils/resolve-host.test.ts @@ -27,7 +27,7 @@ vi.mock("./run-in-container", () => ({ runInContainer: () => runInContainerMock(), })); -test("should return TESTCONTAINERS_HOST_OVERRIDE from environment", async () => { +test.concurrent("should return TESTCONTAINERS_HOST_OVERRIDE from environment", async () => { const strategyResult = { uri: "tcp://another:2375", allowUserOverrides: true, @@ -40,7 +40,7 @@ test("should return TESTCONTAINERS_HOST_OVERRIDE from environment", async () => expect(host).toEqual("tcp://another:2375"); }); -test("should return hostname for TCP protocols", async () => { +test.concurrent("should return hostname for TCP protocols", async () => { for (const uri of ["tcp://docker:2375", "http://docker:2375", "https://docker:2375"]) { const strategyResult = { uri, @@ -53,7 +53,7 @@ test("should return hostname for TCP protocols", async () => { } }); -test("should not return TESTCONTAINERS_HOST_OVERRIDE when allow user override is false", async () => { +test.concurrent("should not return TESTCONTAINERS_HOST_OVERRIDE when allow user override is false", async () => { const strategyResult = { uri: "tcp://docker:2375", allowUserOverrides: false, @@ -66,7 +66,7 @@ test("should not return TESTCONTAINERS_HOST_OVERRIDE when allow user override is expect(host).toEqual("docker"); }); -test("should return localhost for unix and npipe protocols when not running in a container", async () => { +test.concurrent("should return localhost for unix and npipe protocols when not running in a container", async () => { mockExistsSync.mockReturnValue(false); for (const uri of ["unix://docker:2375", "npipe://docker:2375"]) { @@ -81,7 +81,7 @@ test("should return localhost for unix and npipe protocols when not running in a } }); -test("should return host from gateway when running in a container", async () => { +test.concurrent("should return host from gateway when running in a container", async () => { mockExistsSync.mockReturnValue(true); mockInspectNetwork.mockResolvedValue({ IPAM: { @@ -101,7 +101,7 @@ test("should return host from gateway when running in a container", async () => } }); -test("should use bridge network as gateway for Docker provider", async () => { +test.concurrent("should use bridge network as gateway for Docker provider", async () => { mockExistsSync.mockReturnValue(true); mockInspectNetwork.mockResolvedValue({ IPAM: { @@ -121,7 +121,7 @@ test("should use bridge network as gateway for Docker provider", async () => { } }); -test("should use podman network as gateway for Podman provider", async () => { +test.concurrent("should use podman network as gateway for Podman provider", async () => { mockExistsSync.mockReturnValue(true); mockInspectNetwork.mockResolvedValue({ IPAM: { @@ -141,7 +141,7 @@ test("should use podman network as gateway for Podman provider", async () => { } }); -test("should return host from default gateway when running in a container", async () => { +test.concurrent("should return host from default gateway when running in a container", async () => { mockExistsSync.mockReturnValue(true); mockInspectNetwork.mockResolvedValue({}); runInContainerMock.mockResolvedValue("172.0.0.2"); @@ -158,7 +158,7 @@ test("should return host from default gateway when running in a container", asyn } }); -test("should return localhost if unable to find gateway", async () => { +test.concurrent("should return localhost if unable to find gateway", async () => { mockExistsSync.mockReturnValue(true); mockInspectNetwork.mockResolvedValue({}); runInContainerMock.mockResolvedValue(undefined); @@ -175,7 +175,7 @@ test("should return localhost if unable to find gateway", async () => { } }); -test("should throw for unsupported protocol", async () => { +test.concurrent("should throw for unsupported protocol", async () => { const strategyResult = { uri: "invalid://unknown", allowUserOverrides: true, diff --git a/packages/testcontainers/src/container-runtime/utils/run-in-container.test.ts b/packages/testcontainers/src/container-runtime/utils/run-in-container.test.ts index 3f7c15cd3..754c82cd7 100644 --- a/packages/testcontainers/src/container-runtime/utils/run-in-container.test.ts +++ b/packages/testcontainers/src/container-runtime/utils/run-in-container.test.ts @@ -9,7 +9,7 @@ describe("runInContainer", { timeout: 180_000 }, () => { dockerode = (await getContainerRuntimeClient()).container.dockerode; }); - it("should return the command output", async () => { + it.concurrent("should return the command output", async () => { const output = await runInContainer( dockerode, "https://index.docker.io/v1/", @@ -19,7 +19,7 @@ describe("runInContainer", { timeout: 180_000 }, () => { expect(output).toBe("hello world"); }); - it("should return the command output from stderr", async () => { + it.concurrent("should return the command output from stderr", async () => { const output = await runInContainer( dockerode, "https://index.docker.io/v1/", @@ -29,7 +29,7 @@ describe("runInContainer", { timeout: 180_000 }, () => { expect(output).toBe("hello world"); }); - it("should return undefined when the container exits without output", async () => { + it.concurrent("should return undefined when the container exits without output", async () => { const output = await runInContainer( dockerode, "https://index.docker.io/v1/", diff --git a/packages/testcontainers/src/docker-compose-environment/docker-compose-environment.test.ts b/packages/testcontainers/src/docker-compose-environment/docker-compose-environment.test.ts index d97c604db..1ed2f2629 100644 --- a/packages/testcontainers/src/docker-compose-environment/docker-compose-environment.test.ts +++ b/packages/testcontainers/src/docker-compose-environment/docker-compose-environment.test.ts @@ -16,11 +16,11 @@ import { DockerComposeEnvironment } from "./docker-compose-environment"; describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { const fixtures = path.resolve(__dirname, "..", "..", "fixtures", "docker-compose"); - it("should throw error when compose file is malformed", async () => { + it.concurrent("should throw error when compose file is malformed", async () => { await expect(new DockerComposeEnvironment(fixtures, "docker-compose-malformed.yml").up()).rejects.toThrow(); }); - it("should start all containers in the compose file", async () => { + it.concurrent("should start all containers in the compose file", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose.yml").up(); await Promise.all( @@ -32,7 +32,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should start container with a given name", async () => { + it.concurrent("should start container with a given name", async () => { const name = `custom_container_name_${randomUuid()}`; const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-name.yml") .withEnvironment({ CONTAINER_NAME: name }) @@ -44,7 +44,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { }); if (!process.env.CI_PODMAN) { - it("should work with buildkit", async () => { + it.concurrent("should work with buildkit", async () => { const buildkitFixtures = path.resolve(fixtures, "docker-compose-with-buildkit"); const startedEnvironment = await new DockerComposeEnvironment(buildkitFixtures, "docker-compose.yml").up(); await checkEnvironmentContainerIsHealthy(startedEnvironment, await composeContainerName("container")); @@ -52,7 +52,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { }); } - it("should use pull policy", async () => { + it.concurrent("should use pull policy", async () => { const env = new DockerComposeEnvironment(fixtures, "docker-compose-with-many-services.yml"); const startedEnv1 = await env.up(); @@ -66,7 +66,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnv2.stop(); }); - it("should use pull policy for specific service", async () => { + it.concurrent("should use pull policy for specific service", async () => { const env = new DockerComposeEnvironment(fixtures, "docker-compose-with-many-services.yml"); const startedEnv1 = await env.up(["service_2"]); @@ -80,7 +80,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnv2.stop(); }); - it("should start environment with multiple compose files", async () => { + it.concurrent("should start environment with multiple compose files", async () => { const overrideFixtures = path.resolve(fixtures, "docker-compose-with-override"); const startedEnvironment = await new DockerComposeEnvironment(overrideFixtures, [ @@ -98,7 +98,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should support default wait strategy", async () => { + it.concurrent("should support default wait strategy", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-healthcheck.yml") .withDefaultWaitStrategy(Wait.forHealthCheck()) .up(); @@ -108,7 +108,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should support log message wait strategy", async () => { + it.concurrent("should support log message wait strategy", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose.yml") .withWaitStrategy(await composeContainerName("container"), Wait.forLogMessage("Listening on port 8080")) .withWaitStrategy(await composeContainerName("another_container"), Wait.forLogMessage("Listening on port 8080")) @@ -123,7 +123,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should stop the container when the log message wait strategy times out", async () => { + it.concurrent("should stop the container when the log message wait strategy times out", async () => { const name = `custom_container_name_${randomUuid()}`; await expect( new DockerComposeEnvironment(fixtures, "docker-compose-with-name.yml") @@ -136,7 +136,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { expect(await getRunningContainerNames()).not.toContain(name); }); - it("should support health check wait strategy", async () => { + it.concurrent("should support health check wait strategy", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-healthcheck.yml") .withWaitStrategy(await composeContainerName("container"), Wait.forHealthCheck()) .up(); @@ -146,7 +146,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should support failing health check wait strategy", async () => { + it.concurrent("should support failing health check wait strategy", async () => { await expect( new DockerComposeEnvironment(fixtures, "docker-compose-with-healthcheck-unhealthy.yml") .withWaitStrategy(await composeContainerName("container"), Wait.forHealthCheck()) @@ -154,7 +154,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { ).rejects.toThrow(`Health check failed: unhealthy`); }); - it("should stop the container when the health check wait strategy times out", async () => { + it.concurrent("should stop the container when the health check wait strategy times out", async () => { await expect( new DockerComposeEnvironment(fixtures, "docker-compose-with-healthcheck-with-start-period.yml") .withWaitStrategy(await composeContainerName("container"), Wait.forHealthCheck()) @@ -165,7 +165,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { expect(await getRunningContainerNames()).not.toContain("container_1"); }); - it("should remove volumes when downing an environment", async () => { + it.concurrent("should remove volumes when downing an environment", async () => { const environment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-volume.yml").up(); await environment.down(); @@ -174,7 +174,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { expect(testVolumes).toHaveLength(0); }); - it("should not wait for non-public ports", async () => { + it.concurrent("should not wait for non-public ports", async () => { const startedEnvironment = await new DockerComposeEnvironment( fixtures, "docker-compose-with-private-port.yml" @@ -183,7 +183,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should re-build the Dockerfiles", async () => { + it.concurrent("should re-build the Dockerfiles", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose.yml").withBuild().up(); await Promise.all( @@ -195,7 +195,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should bind environment variables to the docker compose file", async () => { + it.concurrent("should bind environment variables to the docker compose file", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-env.yml") .withEnvironment({ ENV_VAR: "ENV_VAR_VALUE" }) .up(); @@ -208,7 +208,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should throw error when you get container that does not exist", async () => { + it.concurrent("should throw error when you get container that does not exist", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose.yml").up(); expect(() => startedEnvironment.getContainer("non_existent_container")).toThrow( @@ -218,7 +218,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should support starting a subset of services defined in the docker-compose file", async () => { + it.concurrent("should support starting a subset of services defined in the docker-compose file", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-many-services.yml").up( ["service_2"] ); @@ -231,7 +231,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should not recreate the containers when no recreate option is set", async () => { + it.concurrent("should not recreate the containers when no recreate option is set", async () => { const startedEnvironment1 = await new DockerComposeEnvironment(fixtures, "docker-compose-with-name.yml") .withEnvironment({ CONTAINER_NAME: `custom_container_name_${randomUuid()}` }) .withNoRecreate() @@ -245,7 +245,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment2.down(); }); - it("should load .env if no environment file option given", async () => { + it.concurrent("should load .env if no environment file option given", async () => { const overrideFixtures = path.resolve(fixtures, "docker-compose-with-env-file"); const startedEnvironment = await new DockerComposeEnvironment(overrideFixtures, "docker-compose.yml").up(); @@ -258,7 +258,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should load the values in the environment file if the environment file option is set", async () => { + it.concurrent("should load the values in the environment file if the environment file option is set", async () => { const overrideFixtures = path.resolve(fixtures, "docker-compose-with-env-file"); const startedEnvironment = await new DockerComposeEnvironment(overrideFixtures, "docker-compose.yml") @@ -273,7 +273,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should start containers with a profile if profile option is set", async () => { + it.concurrent("should start containers with a profile if profile option is set", async () => { const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose-with-profile.yml") .withProfiles("debug") .up(); @@ -287,7 +287,7 @@ describe("DockerComposeEnvironment", { timeout: 180_000 }, () => { await startedEnvironment.down(); }); - it("should use a custom project name if set", async () => { + it.concurrent("should use a custom project name if set", async () => { const customProjectName = `custom-${new RandomUuid().nextUuid()}`; const startedEnvironment = await new DockerComposeEnvironment(fixtures, "docker-compose.yml") .withProjectName(customProjectName) diff --git a/packages/testcontainers/src/generic-container/generic-container-commit.test.ts b/packages/testcontainers/src/generic-container/generic-container-commit.test.ts index 21ab42a2c..fb72c87db 100644 --- a/packages/testcontainers/src/generic-container/generic-container-commit.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-commit.test.ts @@ -10,7 +10,7 @@ describe("GenericContainer commit", { timeout: 180_000 }, () => { const imageName = "cristianrgreco/testcontainer"; const imageVersion = "1.1.14"; - it("should commit container changes to a new image", async () => { + it.concurrent("should commit container changes to a new image", async () => { const testContent = "test content"; const newImageTag = `test-commit-${new RandomUuid().nextUuid()}`; const testAuthor = "test-author"; @@ -47,7 +47,7 @@ describe("GenericContainer commit", { timeout: 180_000 }, () => { await newContainer.stop(); }); - it("should add session ID label when deleteOnExit is true", async () => { + it.concurrent("should add session ID label when deleteOnExit is true", async () => { const newImageTag = `test-commit-${new RandomUuid().nextUuid()}`; const container = await new GenericContainer(`${imageName}:${imageVersion}`).withExposedPorts(8080).start(); @@ -66,7 +66,7 @@ describe("GenericContainer commit", { timeout: 180_000 }, () => { await container.stop(); }); - it("should not add session ID label when deleteOnExit is false", async () => { + it.concurrent("should not add session ID label when deleteOnExit is false", async () => { const newImageTag = `test-commit-${new RandomUuid().nextUuid()}`; const container = await new GenericContainer(`${imageName}:${imageVersion}`).withExposedPorts(8080).start(); diff --git a/packages/testcontainers/src/generic-container/generic-container-dockerfile.test.ts b/packages/testcontainers/src/generic-container/generic-container-dockerfile.test.ts index ec14aff4c..c9929f6db 100644 --- a/packages/testcontainers/src/generic-container/generic-container-dockerfile.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-dockerfile.test.ts @@ -18,7 +18,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { const uuidGen = new RandomUuid(); const fixtures = path.resolve(__dirname, "..", "..", "fixtures", "docker"); - it("should build and start", async () => { + it.concurrent("should build and start", async () => { const context = path.resolve(fixtures, "docker"); const container = await GenericContainer.fromDockerfile(context).build(); const startedContainer = await container.withExposedPorts(8080).start(); @@ -29,7 +29,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { }); if (!process.env.CI_PODMAN) { - it("should build with buildkit", async () => { + it.concurrent("should build with buildkit", async () => { const context = path.resolve(fixtures, "docker-with-buildkit"); const container = await GenericContainer.fromDockerfile(context).withBuildkit().build(); const startedContainer = await container.withExposedPorts(8080).start(); @@ -40,7 +40,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { }); } - it("should have a session ID label to be cleaned up by the Reaper", async () => { + it.concurrent("should have a session ID label to be cleaned up by the Reaper", async () => { const context = path.resolve(fixtures, "docker"); const imageName = `${uuidGen.nextUuid()}:${uuidGen.nextUuid()}`; @@ -54,7 +54,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { await deleteImageByName(imageName); }); - it("should not have a session ID label when delete on exit set to false", async () => { + it.concurrent("should not have a session ID label when delete on exit set to false", async () => { const context = path.resolve(fixtures, "docker"); const imageName = `${uuidGen.nextUuid()}:${uuidGen.nextUuid()}`; @@ -68,7 +68,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { // https://github.com/containers/podman/issues/17779 if (!process.env.CI_PODMAN) { - it("should use pull policy", async () => { + it.concurrent("should use pull policy", async () => { const dockerfile = path.resolve(fixtures, "docker"); const containerSpec = GenericContainer.fromDockerfile(dockerfile).withPullPolicy(PullPolicy.alwaysPull()); @@ -81,7 +81,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { dockerEventStream.destroy(); }); - it("should not pull existing image without pull policy", async () => { + it.concurrent("should not pull existing image without pull policy", async () => { const client = await getContainerRuntimeClient(); await client.image.pull(new ImageName("docker.io", "node", "10-alpine")); @@ -101,7 +101,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { }); } - it("should build and start with custom file name", async () => { + it.concurrent("should build and start with custom file name", async () => { const context = path.resolve(fixtures, "docker-with-custom-filename"); const container = await GenericContainer.fromDockerfile(context, "Dockerfile-A").build(); const startedContainer = await container.withExposedPorts(8080).start(); @@ -111,7 +111,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { await startedContainer.stop(); }); - it("should set build arguments", async () => { + it.concurrent("should set build arguments", async () => { const context = path.resolve(fixtures, "docker-with-buildargs"); const container = await GenericContainer.fromDockerfile(context).withBuildArgs({ VERSION: "10-alpine" }).build(); const startedContainer = await container.withExposedPorts(8080).start(); @@ -121,7 +121,7 @@ describe("GenericContainer Dockerfile", { timeout: 180_000 }, () => { await startedContainer.stop(); }); - it("should exit immediately and stop without exception", async () => { + it.concurrent("should exit immediately and stop without exception", async () => { const message = "This container will exit immediately."; const context = path.resolve(fixtures, "docker-exit-immediately"); const container = await GenericContainer.fromDockerfile(context).build(); diff --git a/packages/testcontainers/src/generic-container/generic-container-lifecycle.test.ts b/packages/testcontainers/src/generic-container/generic-container-lifecycle.test.ts index 9003df48e..bad3823fd 100644 --- a/packages/testcontainers/src/generic-container/generic-container-lifecycle.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-lifecycle.test.ts @@ -18,7 +18,7 @@ describe("GenericContainer lifecycle", { timeout: 180_000 }, () => { containerStopped = vi.fn(); }); - it("should call lifecycle callbacks for a non-reused, generic container", async () => { + it.concurrent("should call lifecycle callbacks for a non-reused, generic container", async () => { const container = await new CustomContainerWithCustomStartedContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .start(); @@ -33,7 +33,7 @@ describe("GenericContainer lifecycle", { timeout: 180_000 }, () => { expect(containerStopped).toHaveBeenCalled(); }); - it("should not call lifecycle callbacks for a reused, generic container", async () => { + it.concurrent("should not call lifecycle callbacks for a reused, generic container", async () => { const container1 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withReuse() diff --git a/packages/testcontainers/src/generic-container/generic-container-logs.test.ts b/packages/testcontainers/src/generic-container/generic-container-logs.test.ts index 85a1c565b..f66a78c8f 100644 --- a/packages/testcontainers/src/generic-container/generic-container-logs.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-logs.test.ts @@ -3,7 +3,7 @@ import { Wait } from "../wait-strategies/wait"; import { GenericContainer } from "./generic-container"; describe("GenericContainer logs", { timeout: 180_000 }, () => { - it("should stream logs from a container before start", async () => { + it.concurrent("should stream logs from a container before start", async () => { const line = await new Promise((resolve) => { return new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -15,7 +15,7 @@ describe("GenericContainer logs", { timeout: 180_000 }, () => { expect(line).toContain("Listening on port 8080"); }); - it("should stream logs from a started container", async () => { + it.concurrent("should stream logs from a started container", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); const stream = await container.logs(); @@ -25,7 +25,7 @@ describe("GenericContainer logs", { timeout: 180_000 }, () => { await container.stop(); }); - it("should stream logs with since option from a started container", async () => { + it.concurrent("should stream logs with since option from a started container", async () => { const pauseMs = 5 * 1000; const logBeforeSleep = "first"; const logAfterSleep = "second"; @@ -51,7 +51,7 @@ describe("GenericContainer logs", { timeout: 180_000 }, () => { await container.stop(); }); - it("should stream logs from a running container after restart", async () => { + it.concurrent("should stream logs from a running container after restart", async () => { const containerLogTraceSpy = vi.spyOn(containerLog, "trace"); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); diff --git a/packages/testcontainers/src/generic-container/generic-container-network.test.ts b/packages/testcontainers/src/generic-container/generic-container-network.test.ts index 03e3af41e..4327aff94 100644 --- a/packages/testcontainers/src/generic-container/generic-container-network.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-network.test.ts @@ -3,7 +3,7 @@ import { Network } from "../network/network"; import { GenericContainer } from "./generic-container"; describe("GenericContainer network", { timeout: 180_000 }, () => { - it("should set network mode", async () => { + it.concurrent("should set network mode", async () => { const client = await getContainerRuntimeClient(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withNetworkMode("host").start(); const dockerContainer = await client.container.getById(container.getId()); @@ -14,7 +14,7 @@ describe("GenericContainer network", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set network aliases", async () => { + it.concurrent("should set network aliases", async () => { const network = await new Network().start(); const fooContainer = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withNetwork(network) @@ -35,7 +35,7 @@ describe("GenericContainer network", { timeout: 180_000 }, () => { await network.stop(); }); - it("should set extra hosts", async () => { + it.concurrent("should set extra hosts", async () => { const fooContainer = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").start(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") diff --git a/packages/testcontainers/src/generic-container/generic-container-resources-quota.test.ts b/packages/testcontainers/src/generic-container/generic-container-resources-quota.test.ts index a99376a7e..906d4fc01 100644 --- a/packages/testcontainers/src/generic-container/generic-container-resources-quota.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-resources-quota.test.ts @@ -9,7 +9,7 @@ describe("GenericContainer resources quota", { timeout: 180_000 }, () => { }); if (!process.env["CI_ROOTLESS"]) { - it("should set resources quota", async () => { + it.concurrent("should set resources quota", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withResourcesQuota({ memory: 0.5, cpu: 1 }) .start(); @@ -24,7 +24,7 @@ describe("GenericContainer resources quota", { timeout: 180_000 }, () => { }); } - it("resources quota should be 0 for cpu and memory if not set by user", async () => { + it.concurrent("resources quota should be 0 for cpu and memory if not set by user", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").start(); const dockerContainer = await client.container.getById(container.getId()); @@ -36,7 +36,7 @@ describe("GenericContainer resources quota", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set resources quota memory only, cpu should be 0", async () => { + it.concurrent("should set resources quota memory only, cpu should be 0", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withResourcesQuota({ memory: 0.5 }) .start(); @@ -51,7 +51,7 @@ describe("GenericContainer resources quota", { timeout: 180_000 }, () => { }); if (!process.env["CI_ROOTLESS"]) { - it("should set resources quota cpu only, memory should be 0", async () => { + it.concurrent("should set resources quota cpu only, memory should be 0", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withResourcesQuota({ cpu: 1 }) .start(); diff --git a/packages/testcontainers/src/generic-container/generic-container-restart.test.ts b/packages/testcontainers/src/generic-container/generic-container-restart.test.ts index 68e721ed0..ccfb153bf 100644 --- a/packages/testcontainers/src/generic-container/generic-container-restart.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-restart.test.ts @@ -3,7 +3,7 @@ import { checkContainerIsHealthy } from "../utils/test-helper"; import { GenericContainer } from "./generic-container"; describe("GenericContainer restart", { timeout: 180_000 }, () => { - it("should restart", async () => { + it.concurrent("should restart", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`container-${new RandomUuid().nextUuid()}`) .withExposedPorts(8080) @@ -18,7 +18,7 @@ describe("GenericContainer restart", { timeout: 180_000 }, () => { await container.stop(); }); - it("should restart persisting state", async () => { + it.concurrent("should restart persisting state", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`container-${new RandomUuid().nextUuid()}`) .withExposedPorts(8080) diff --git a/packages/testcontainers/src/generic-container/generic-container-reuse.test.ts b/packages/testcontainers/src/generic-container/generic-container-reuse.test.ts index b54f521d7..6a23e4e67 100644 --- a/packages/testcontainers/src/generic-container/generic-container-reuse.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container-reuse.test.ts @@ -3,7 +3,7 @@ import { checkContainerIsHealthy } from "../utils/test-helper"; import { GenericContainer } from "./generic-container"; describe("GenericContainer reuse", { timeout: 180_000 }, () => { - it("should not reuse the container by default", async () => { + it.concurrent("should not reuse the container by default", async () => { const name = `there_can_only_be_one_${randomUuid()}`; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(name) @@ -20,7 +20,7 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { } }); - it("should not reuse the container even when there is a candidate 1", async () => { + it.concurrent("should not reuse the container even when there is a candidate 1", async () => { const name = `there_can_only_be_one_${randomUuid()}`; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(name) @@ -38,7 +38,7 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { } }); - it("should not reuse the container even when there is a candidate 2", async () => { + it.concurrent("should not reuse the container even when there is a candidate 2", async () => { const name = `there_can_only_be_one_${randomUuid()}`; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(name) @@ -59,7 +59,7 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { } }); - it("should not reuse the container when TESTCONTAINERS_REUSE_ENABLE is set to false", async () => { + it.concurrent("should not reuse the container when TESTCONTAINERS_REUSE_ENABLE is set to false", async () => { vi.stubEnv("TESTCONTAINERS_REUSE_ENABLE", "false"); const name = `there_can_only_be_one_${randomUuid()}`; @@ -109,27 +109,30 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { } ); - it("should create a new container when an existing reusable container has stopped and is removed", async () => { - const name = `there_can_only_be_one_${randomUuid()}`; - const container1 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") - .withName(name) - .withExposedPorts(8080) - .withReuse() - .start(); - await container1.stop(); + it.concurrent( + "should create a new container when an existing reusable container has stopped and is removed", + async () => { + const name = `there_can_only_be_one_${randomUuid()}`; + const container1 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") + .withName(name) + .withExposedPorts(8080) + .withReuse() + .start(); + await container1.stop(); - const container2 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") - .withName(name) - .withExposedPorts(8080) - .withReuse() - .start(); - await checkContainerIsHealthy(container2); + const container2 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") + .withName(name) + .withExposedPorts(8080) + .withReuse() + .start(); + await checkContainerIsHealthy(container2); - expect(container1.getId()).not.toBe(container2.getId()); - await container2.stop(); - }); + expect(container1.getId()).not.toBe(container2.getId()); + await container2.stop(); + } + ); - it("should reuse stopped container, if configured withAutoRemove(false)", async () => { + it.concurrent("should reuse stopped container, if configured withAutoRemove(false)", async () => { const name = `will_stop_and_reuse_again_${randomUuid()}`; const container1 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(name) @@ -150,7 +153,7 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { await container2.stop({ remove: true }); }); - it("should reuse container when an existing reusable container has stopped but not removed", async () => { + it.concurrent("should reuse container when an existing reusable container has stopped but not removed", async () => { const name = `there_can_only_be_one_${randomUuid()}`; const container1 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(name) @@ -170,7 +173,7 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { await container2.stop(); }); - it("should keep the labels passed in when a new reusable container is created", async () => { + it.concurrent("should keep the labels passed in when a new reusable container is created", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`there_can_only_be_one_${randomUuid()}`) .withExposedPorts(8080) @@ -182,7 +185,7 @@ describe("GenericContainer reuse", { timeout: 180_000 }, () => { await container.stop(); }); - it("should not create multiple reusable containers if called in parallel", async () => { + it.concurrent("should not create multiple reusable containers if called in parallel", async () => { const [container1, container2] = await Promise.all([ new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).withReuse().start(), new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).withReuse().start(), diff --git a/packages/testcontainers/src/generic-container/generic-container.test.ts b/packages/testcontainers/src/generic-container/generic-container.test.ts index b96cc5d90..bceb63c6a 100644 --- a/packages/testcontainers/src/generic-container/generic-container.test.ts +++ b/packages/testcontainers/src/generic-container/generic-container.test.ts @@ -14,7 +14,7 @@ import { GenericContainer } from "./generic-container"; describe("GenericContainer", { timeout: 180_000 }, () => { const fixtures = path.resolve(__dirname, "..", "..", "fixtures", "docker"); - it("should return first mapped port", async () => { + it.concurrent("should return first mapped port", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); expect(container.getFirstMappedPort()).toBe(container.getMappedPort(8080)); @@ -22,7 +22,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should bind to specified host port", async () => { + it.concurrent("should bind to specified host port", async () => { const hostPort = await getPort(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts({ @@ -37,7 +37,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should execute a command on a running container", async () => { + it.concurrent("should execute a command on a running container", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); const { output, stdout, stderr, exitCode } = await container.exec(["echo", "hello", "world"]); @@ -50,7 +50,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should execute a command in a different working directory", async () => { + it.concurrent("should execute a command in a different working directory", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); const { output, stdout, stderr, exitCode } = await container.exec(["pwd"], { workingDir: "/var/log" }); @@ -63,7 +63,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should execute a command with custom environment variables", async () => { + it.concurrent("should execute a command with custom environment variables", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); const { output, stdout, stderr, exitCode } = await container.exec(["env"], { env: { TEST_ENV: "test" } }); @@ -76,7 +76,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should execute a command with a different user", async () => { + it.concurrent("should execute a command with a different user", async () => { // By default, node:alpine runs as root const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); @@ -90,7 +90,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should capture stderr when a command fails", async () => { + it.concurrent("should capture stderr when a command fails", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); const { output, stdout, stderr, exitCode } = await container.exec(["ls", "/nonexistent/path"]); @@ -103,7 +103,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should capture stdout and stderr in the correct order", async () => { + it.concurrent("should capture stdout and stderr in the correct order", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); // The command first writes to stdout and then tries to access a nonexistent file (stderr) @@ -122,7 +122,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set environment variables", async () => { + it.concurrent("should set environment variables", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withEnvironment({ customKey: "customValue" }) .withExposedPorts(8080) @@ -136,7 +136,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set command", async () => { + it.concurrent("should set command", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withCommand(["node", "index.js", "one", "two", "three"]) .withExposedPorts(8080) @@ -150,7 +150,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set working directory", async () => { + it.concurrent("should set working directory", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withWorkingDir("/tmp") .withCommand(["node", "../index.js"]) @@ -161,7 +161,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { expect(output).toEqual(expect.stringContaining("/tmp")); }); - it("should set platform", async () => { + it.concurrent("should set platform", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withPullPolicy(PullPolicy.alwaysPull()) .withCommand(["node", "../index.js"]) @@ -173,7 +173,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { expect(output).toEqual(expect.stringContaining("x86_64")); }); - it("should set entrypoint", async () => { + it.concurrent("should set entrypoint", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withEntrypoint(["node"]) .withCommand(["index.js"]) @@ -185,7 +185,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set name", async () => { + it.concurrent("should set name", async () => { const containerName = "special-test-container"; const expectedContainerName = "/special-test-container"; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withName(containerName).start(); @@ -195,7 +195,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set labels", async () => { + it.concurrent("should set labels", async () => { const labels = { ["label-1"]: "value-1", ["label-2"]: "value-2", @@ -208,7 +208,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set bind mounts", async () => { + it.concurrent("should set bind mounts", async () => { const filename = "test.txt"; const source = path.resolve(fixtures, "docker", filename); const target = `/tmp/${filename}`; @@ -224,7 +224,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set tmpfs", async () => { + it.concurrent("should set tmpfs", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withTmpFs({ "/testtmpfs": "rw" }) .withExposedPorts(8080) @@ -243,7 +243,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { }); if (!process.env["CI_ROOTLESS"]) { - it("should set ulimits", async () => { + it.concurrent("should set ulimits", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withUlimits({ memlock: { hard: -1, soft: -1 } }) .withExposedPorts(8080) @@ -256,7 +256,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { }); } - it("should add capabilities", async () => { + it.concurrent("should add capabilities", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withAddedCapabilities("IPC_LOCK") .withExposedPorts(8080) @@ -268,7 +268,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should drop capabilities", async () => { + it.concurrent("should drop capabilities", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withDroppedCapabilities("CHOWN") .withExposedPorts(8080) @@ -280,7 +280,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set default log driver", async () => { + it.concurrent("should set default log driver", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withDefaultLogDriver().start(); const client = await getContainerRuntimeClient(); @@ -295,7 +295,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set privileged mode", async () => { + it.concurrent("should set privileged mode", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withPrivilegedMode() .withExposedPorts(8080) @@ -310,7 +310,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should use pull policy", async () => { + it.concurrent("should use pull policy", async () => { const container = new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080); const startedContainer1 = await container.start(); @@ -324,7 +324,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await startedContainer2.stop(); }); - it("should set the IPC mode", async () => { + it.concurrent("should set the IPC mode", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withIpcMode("host") .withExposedPorts(8080) @@ -335,7 +335,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set the user", async () => { + it.concurrent("should set the user", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withUser("node") .withExposedPorts(8080) @@ -348,7 +348,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy file to container", async () => { + it.concurrent("should copy file to container", async () => { const source = path.resolve(fixtures, "docker", "test.txt"); const target = "/tmp/test.txt"; @@ -362,7 +362,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy file to container with permissions", async () => { + it.concurrent("should copy file to container with permissions", async () => { const source = path.resolve(fixtures, "docker", "test.txt"); const target = "/tmp/test.txt"; const mode = parseInt("0777", 8); @@ -377,7 +377,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy file to started container", async () => { + it.concurrent("should copy file to started container", async () => { const source = path.resolve(fixtures, "docker", "test.txt"); const target = "/tmp/test.txt"; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); @@ -389,7 +389,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy directory to container", async () => { + it.concurrent("should copy directory to container", async () => { const source = path.resolve(fixtures, "docker"); const target = "/tmp"; @@ -403,7 +403,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy directory to container with permissions", async () => { + it.concurrent("should copy directory to container with permissions", async () => { const source = path.resolve(fixtures, "docker"); const target = "/tmp/newdir"; const mode = parseInt("0777", 8); @@ -418,7 +418,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy directory to started container", async () => { + it.concurrent("should copy directory to started container", async () => { const source = path.resolve(fixtures, "docker"); const target = "/tmp"; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); @@ -430,7 +430,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy content to container", async () => { + it.concurrent("should copy content to container", async () => { const content = "hello world"; const target = "/tmp/test.txt"; @@ -444,7 +444,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy content to container with permissions", async () => { + it.concurrent("should copy content to container with permissions", async () => { const content = "hello world"; const target = "/tmp/test.txt"; const mode = parseInt("0777", 8); @@ -459,7 +459,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should copy content to started container", async () => { + it.concurrent("should copy content to started container", async () => { const content = "hello world"; const target = "/tmp/test.txt"; const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); @@ -471,7 +471,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await container.stop(); }); - it("should honour .dockerignore file", async () => { + it.concurrent("should honour .dockerignore file", async () => { const context = path.resolve(fixtures, "docker-with-dockerignore"); const container = await GenericContainer.fromDockerfile(context).build(); const startedContainer = await container.withExposedPorts(8080).start(); @@ -493,7 +493,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await startedContainer.stop(); }); - it("should stop the container", async () => { + it.concurrent("should stop the container", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`container-${new RandomUuid().nextUuid()}`) .start(); @@ -503,7 +503,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { expect(await getRunningContainerNames()).not.toContain(container.getName()); }); - it("should stop the container idempotently", async () => { + it.concurrent("should stop the container idempotently", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`container-${new RandomUuid().nextUuid()}`) .start(); @@ -518,7 +518,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { expect(await getRunningContainerNames()).not.toContain(container.getName()); }); - it("should stop but not remove the container", async () => { + it.concurrent("should stop but not remove the container", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`container-${new RandomUuid().nextUuid()}`) .withAutoRemove(false) @@ -531,7 +531,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { expect((await lowerLevelContainer.inspect()).State.Status).toEqual("exited"); }); - it("should stop and override .withAutoRemove", async () => { + it.concurrent("should stop and override .withAutoRemove", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withName(`container-${new RandomUuid().nextUuid()}`) .withAutoRemove(false) @@ -546,7 +546,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await expect(lowerLevelContainer.inspect()).rejects.toThrow(/404/); // Error: (HTTP code 404) no such container }); - it("should build a target stage", async () => { + it.concurrent("should build a target stage", async () => { const context = path.resolve(fixtures, "docker-multi-stage"); const firstContainer = await GenericContainer.fromDockerfile(context).withTarget("first").build(); const secondContainer = await GenericContainer.fromDockerfile(context).withTarget("second").build(); @@ -561,7 +561,7 @@ describe("GenericContainer", { timeout: 180_000 }, () => { await secondStartedContainer.stop(); }); - it("should set the hostname", async () => { + it.concurrent("should set the hostname", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withHostname("hostname") .start(); diff --git a/packages/testcontainers/src/generic-container/inspect-container-util-ports-exposed.test.ts b/packages/testcontainers/src/generic-container/inspect-container-util-ports-exposed.test.ts index b198bb02d..3b2ab37be 100644 --- a/packages/testcontainers/src/generic-container/inspect-container-util-ports-exposed.test.ts +++ b/packages/testcontainers/src/generic-container/inspect-container-util-ports-exposed.test.ts @@ -29,7 +29,7 @@ function mockInspectResult(ports: ContainerInspectInfo["NetworkSettings"]["Ports return { inspectResult, mappedInspectResult: mapInspectResult(inspectResult) }; } -test("returns the inspect results when all ports are exposed", async () => { +test.concurrent("returns the inspect results when all ports are exposed", async () => { const data = mockInspectResult({ "8080/tcp": [{ HostIp: "0.0.0.0", HostPort: "45000" }] }); const inspectFn = vi.fn().mockResolvedValueOnce(data.inspectResult); @@ -38,7 +38,7 @@ test("returns the inspect results when all ports are exposed", async () => { expect(result).toEqual(data); }); -test("retries the inspect if ports are not yet exposed", async () => { +test.concurrent("retries the inspect if ports are not yet exposed", async () => { const data1 = mockInspectResult({ "8080/tcp": [] }); const data2 = mockInspectResult({ "8080/tcp": [{ HostIp: "0.0.0.0", HostPort: "45000" }] }); const inspectFn = vi @@ -53,7 +53,7 @@ test("retries the inspect if ports are not yet exposed", async () => { expect(inspectFn).toHaveBeenCalledTimes(3); }); -test("throws an error when host ports are not exposed within timeout", async () => { +test.concurrent("throws an error when host ports are not exposed within timeout", async () => { const data = mockInspectResult({ "8080/tcp": [] }); const inspectFn = vi.fn().mockResolvedValue(data.inspectResult); @@ -62,7 +62,7 @@ test("throws an error when host ports are not exposed within timeout", async () ); }); -test("throws an error when container ports not exposed within timeout", async () => { +test.concurrent("throws an error when container ports not exposed within timeout", async () => { const data = mockInspectResult({}); const inspectFn = vi.fn().mockResolvedValue(data.inspectResult); diff --git a/packages/testcontainers/src/network/network.test.ts b/packages/testcontainers/src/network/network.test.ts index e7ccb2488..e295c3ecf 100644 --- a/packages/testcontainers/src/network/network.test.ts +++ b/packages/testcontainers/src/network/network.test.ts @@ -9,7 +9,7 @@ describe("Network", { timeout: 180_000 }, () => { client = await getContainerRuntimeClient(); }); - it("should start container via network mode", async () => { + it.concurrent("should start container via network mode", async () => { const network = await new Network().start(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") @@ -24,7 +24,7 @@ describe("Network", { timeout: 180_000 }, () => { await network.stop(); }); - it("should start container via network", async () => { + it.concurrent("should start container via network", async () => { const network = await new Network().start(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withNetwork(network).start(); @@ -37,7 +37,7 @@ describe("Network", { timeout: 180_000 }, () => { await network.stop(); }); - it("two containers in user-defined network should be able to ping each other by name", async () => { + it.concurrent("two containers in user-defined network should be able to ping each other by name", async () => { const network = await new Network().start(); const container1 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") @@ -59,7 +59,7 @@ describe("Network", { timeout: 180_000 }, () => { await network.stop(); }); - it("should expose the IP address of a container in a given network", async () => { + it.concurrent("should expose the IP address of a container in a given network", async () => { const network = await new Network().start(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withNetwork(network).start(); diff --git a/packages/testcontainers/src/port-forwarder/port-forwarder-reuse.test.ts b/packages/testcontainers/src/port-forwarder/port-forwarder-reuse.test.ts index 4f62961b7..c6c908bdd 100644 --- a/packages/testcontainers/src/port-forwarder/port-forwarder-reuse.test.ts +++ b/packages/testcontainers/src/port-forwarder/port-forwarder-reuse.test.ts @@ -5,7 +5,7 @@ import { createTestServer } from "../utils/test-helper"; describe("Port Forwarder reuse", { timeout: 180_000 }, () => { const portGen = new RandomPortGenerator(); - it("should expose additional ports", async () => { + it.concurrent("should expose additional ports", async () => { const { TestContainers: TC1 } = await import("../test-containers"); const { PortForwarderInstance: PFI1 } = await import("../port-forwarder/port-forwarder"); const port1 = await portGen.generatePort(); @@ -34,7 +34,7 @@ describe("Port Forwarder reuse", { timeout: 180_000 }, () => { await container.stop(); }); - it("should reuse same ports", async () => { + it.concurrent("should reuse same ports", async () => { const port = await portGen.generatePort(); const server = await createTestServer(port); diff --git a/packages/testcontainers/src/port-forwarder/port-forwarder.test.ts b/packages/testcontainers/src/port-forwarder/port-forwarder.test.ts index c28ef7480..b9007997c 100644 --- a/packages/testcontainers/src/port-forwarder/port-forwarder.test.ts +++ b/packages/testcontainers/src/port-forwarder/port-forwarder.test.ts @@ -18,7 +18,7 @@ describe("PortForwarder", { timeout: 180_000 }, () => { await new Promise((resolve) => server.close(resolve)); }); - it("should expose host ports to the container", async () => { + it.concurrent("should expose host ports to the container", async () => { await TestContainers.exposeHostPorts(randomPort); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").start(); @@ -29,7 +29,7 @@ describe("PortForwarder", { timeout: 180_000 }, () => { await container.stop(); }); - it("should expose host ports to the container with custom network", async () => { + it.concurrent("should expose host ports to the container with custom network", async () => { await TestContainers.exposeHostPorts(randomPort); const network = await new Network().start(); @@ -42,7 +42,7 @@ describe("PortForwarder", { timeout: 180_000 }, () => { await network.stop(); }); - it("should expose host ports to the container with custom network and network alias", async () => { + it.concurrent("should expose host ports to the container with custom network and network alias", async () => { await TestContainers.exposeHostPorts(randomPort); const network = await new Network().start(); diff --git a/packages/testcontainers/src/reaper/reaper.test.ts b/packages/testcontainers/src/reaper/reaper.test.ts index 1227f5368..0e2adb9ab 100644 --- a/packages/testcontainers/src/reaper/reaper.test.ts +++ b/packages/testcontainers/src/reaper/reaper.test.ts @@ -12,7 +12,7 @@ describe("Reaper", { timeout: 120_000 }, () => { client = await getContainerRuntimeClient(); }); - it("should create disabled reaper when TESTCONTAINERS_RYUK_DISABLED=true", async () => { + it.concurrent("should create disabled reaper when TESTCONTAINERS_RYUK_DISABLED=true", async () => { vi.stubEnv("TESTCONTAINERS_RYUK_DISABLED", "true"); vi.spyOn(client.container, "list").mockResolvedValue([]); @@ -22,7 +22,7 @@ describe("Reaper", { timeout: 120_000 }, () => { expect(() => reaper.addComposeProject("test-project")).not.toThrow(); }); - it("should return cached reaper instance", async () => { + it.concurrent("should return cached reaper instance", async () => { vi.spyOn(client.container, "list").mockResolvedValue([]); const reaper = await getReaper(); @@ -31,7 +31,7 @@ describe("Reaper", { timeout: 120_000 }, () => { expect(reaper2.containerId).toBe(reaper.containerId); }); - it("should create new reaper container if one is not running", async () => { + it.concurrent("should create new reaper container if one is not running", async () => { vi.spyOn(client.container, "list").mockResolvedValue([]); const reaper = await getReaper(); vi.resetModules(); @@ -41,7 +41,7 @@ describe("Reaper", { timeout: 120_000 }, () => { expect(reaper2.containerId).not.toBe(reaper.containerId); }); - it("should reuse existing reaper container if one is already running", async () => { + it.concurrent("should reuse existing reaper container if one is already running", async () => { const reaper = await getReaper(); vi.resetModules(); const reaperContainerInfo = (await client.container.list()).filter((c) => c.Id === reaper.containerId)[0]; @@ -53,7 +53,7 @@ describe("Reaper", { timeout: 120_000 }, () => { expect(reaper2.containerId).toBe(reaper.containerId); }); - it("should use custom port when TESTCONTAINERS_RYUK_PORT is set", async () => { + it.concurrent("should use custom port when TESTCONTAINERS_RYUK_PORT is set", async () => { const customPort = (await new RandomPortGenerator().generatePort()).toString(); vi.stubEnv("TESTCONTAINERS_RYUK_PORT", customPort); vi.spyOn(client.container, "list").mockResolvedValue([]); @@ -66,7 +66,7 @@ describe("Reaper", { timeout: 120_000 }, () => { expect(port[0].HostPort).toBe(customPort); }); - it("should create Reaper container without RYUK_VERBOSE env var by default", async () => { + it.concurrent("should create Reaper container without RYUK_VERBOSE env var by default", async () => { vi.spyOn(client.container, "list").mockResolvedValue([]); const reaper = await getReaper(); @@ -76,7 +76,7 @@ describe("Reaper", { timeout: 120_000 }, () => { expect(reaperContainerEnv).not.toContain("RYUK_VERBOSE=false"); }); - it("should propagate TESTCONTAINERS_RYUK_VERBOSE into Reaper container", async () => { + it.concurrent("should propagate TESTCONTAINERS_RYUK_VERBOSE into Reaper container", async () => { vi.stubEnv("TESTCONTAINERS_RYUK_VERBOSE", "true"); vi.spyOn(client.container, "list").mockResolvedValue([]); diff --git a/packages/testcontainers/src/socat/socat-container.test.ts b/packages/testcontainers/src/socat/socat-container.test.ts index b74a9f351..13711a9f0 100644 --- a/packages/testcontainers/src/socat/socat-container.test.ts +++ b/packages/testcontainers/src/socat/socat-container.test.ts @@ -3,7 +3,7 @@ import { Network } from "../network/network"; import { SocatContainer } from "./socat-container"; describe("SocatContainer", { timeout: 120_000 }, () => { - it("should forward requests to helloworld container", async () => { + it.concurrent("should forward requests to helloworld container", async () => { const network = await new Network().start(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -23,7 +23,7 @@ describe("SocatContainer", { timeout: 120_000 }, () => { await network.stop(); }); - it("should forward requests to helloworld container in a different port", async () => { + it.concurrent("should forward requests to helloworld container in a different port", async () => { const network = await new Network().start(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) diff --git a/packages/testcontainers/src/utils/bound-ports.test.ts b/packages/testcontainers/src/utils/bound-ports.test.ts index bb585793b..f4741d31d 100644 --- a/packages/testcontainers/src/utils/bound-ports.test.ts +++ b/packages/testcontainers/src/utils/bound-ports.test.ts @@ -3,7 +3,7 @@ import { InspectResult } from "../types"; import { BoundPorts, resolveHostPortBinding } from "./bound-ports"; describe("BoundPorts", () => { - it("should return a binding", () => { + it.concurrent("should return a binding", () => { const boundPorts = new BoundPorts(); boundPorts.setBinding(1, 1000); @@ -11,7 +11,7 @@ describe("BoundPorts", () => { }); describe("BoundPorts", () => { - it("should return a binding", () => { + it.concurrent("should return a binding", () => { const boundPorts = new BoundPorts(); boundPorts.setBinding(1, 1000); @@ -19,21 +19,21 @@ describe("BoundPorts", () => { }); describe("get first binding", () => { - it("should return", () => { + it.concurrent("should return", () => { const boundPorts = new BoundPorts(); boundPorts.setBinding(1, 1000); expect(boundPorts.getFirstBinding()).toBe(1000); }); - it("should throw when not set", () => { + it.concurrent("should throw when not set", () => { const boundPorts = new BoundPorts(); expect(() => boundPorts.getFirstBinding()).toThrowError("No port bindings found"); }); }); - it("should return an iterator for all bindings", () => { + it.concurrent("should return an iterator for all bindings", () => { const boundPorts = new BoundPorts(); boundPorts.setBinding(1, 1000); @@ -43,7 +43,7 @@ describe("BoundPorts", () => { } }); - it("should instantiate from an inspect result", () => { + it.concurrent("should instantiate from an inspect result", () => { const inspectResult: Partial = { ports: { 8080: [{ hostIp: "0.0.0.0", hostPort: 10000 }], @@ -58,7 +58,7 @@ describe("BoundPorts", () => { expect(boundPorts.getBinding(8081)).toBe(10001); }); - it("should filter port bindings", () => { + it.concurrent("should filter port bindings", () => { const boundPorts = new BoundPorts(); boundPorts.setBinding(1, 1000); boundPorts.setBinding(2, 2000); @@ -71,7 +71,7 @@ describe("BoundPorts", () => { }); describe("resolveHostPortBinding", () => { - it("should return IPv6-mapped host port when preferred", () => { + it.concurrent("should return IPv6-mapped host port when preferred", () => { const hostIps: HostIp[] = [ { address: "::1", family: 6 }, { address: "127.0.0.1", family: 4 }, @@ -83,7 +83,7 @@ describe("BoundPorts", () => { expect(resolveHostPortBinding(hostIps, ports)).toBe(50001); }); - it("should return IPv4-mapped host port when preferred", () => { + it.concurrent("should return IPv4-mapped host port when preferred", () => { const hostIps: HostIp[] = [ { address: "127.0.0.1", family: 4 }, { address: "::1", family: 6 }, @@ -96,7 +96,7 @@ describe("BoundPorts", () => { }); // https://github.com/containers/podman/issues/17780 - it("should return mapped host port when dual stack IP", () => { + it.concurrent("should return mapped host port when dual stack IP", () => { const hostIps: HostIp[] = [ { address: "127.0.0.1", family: 4 }, { address: "::1", family: 6 }, @@ -105,7 +105,7 @@ describe("BoundPorts", () => { expect(resolveHostPortBinding(hostIps, ports)).toBe(50000); }); - it("should throw when no host port available for host IP family", () => { + it.concurrent("should throw when no host port available for host IP family", () => { const hostIps: HostIp[] = [{ address: "::1", family: 6 }]; const ports = [{ hostIp: "0.0.0.0", hostPort: 50000 }]; expect(() => resolveHostPortBinding(hostIps, ports)).toThrow("No host port found for host IP"); diff --git a/packages/testcontainers/src/utils/dockerfile-parser.test.ts b/packages/testcontainers/src/utils/dockerfile-parser.test.ts index 57c32b070..1d492fe5d 100644 --- a/packages/testcontainers/src/utils/dockerfile-parser.test.ts +++ b/packages/testcontainers/src/utils/dockerfile-parser.test.ts @@ -5,37 +5,37 @@ import { getDockerfileImages } from "./dockerfile-parser"; const dockerfileParserFixtures = path.resolve(__dirname, "..", "..", "fixtures", "docker", "dockerfile-parser"); describe("DockerfileParser", () => { - it("should return image name", async () => { + it.concurrent("should return image name", async () => { const dockerfile = path.resolve(dockerfileParserFixtures, "Dockerfile"); const images = await getDockerfileImages(dockerfile, {}); expect(images).toEqual([ImageName.fromString("node:10-alpine")]); }); - it("should return multiple images for multi-stage build", async () => { + it.concurrent("should return multiple images for multi-stage build", async () => { const dockerfile = path.resolve(dockerfileParserFixtures, "multistage.Dockerfile"); const images = await getDockerfileImages(dockerfile, {}); expect(images).toEqual([ImageName.fromString("node:latest"), ImageName.fromString("alpine:latest")]); }); - it("should work when formatted with spaces", async () => { + it.concurrent("should work when formatted with spaces", async () => { const dockerfile = path.resolve(dockerfileParserFixtures, "formatted.Dockerfile"); const images = await getDockerfileImages(dockerfile, {}); expect(images).toEqual([ImageName.fromString("node:latest")]); }); - it("should return unique images for multi-stage build", async () => { + it.concurrent("should return unique images for multi-stage build", async () => { const dockerfile = path.resolve(dockerfileParserFixtures, "multistage-duplicate.Dockerfile"); const images = await getDockerfileImages(dockerfile, {}); expect(images).toEqual([ImageName.fromString("node:latest")]); }); - it("should return images for multi-stage build with named stages", async () => { + it.concurrent("should return images for multi-stage build with named stages", async () => { const dockerfile = path.resolve(dockerfileParserFixtures, "multistage-naming.Dockerfile"); const images = await getDockerfileImages(dockerfile, {}); expect(images).toEqual([ImageName.fromString("node:latest"), ImageName.fromString("alpine:latest")]); }); - it("should return images with build args", async () => { + it.concurrent("should return images with build args", async () => { const dockerfile = path.resolve(dockerfileParserFixtures, "buildargs.Dockerfile"); const images = await getDockerfileImages(dockerfile, { repositoryName: "cristianrgreco", repositoryPort: "5000" }); expect(images).toEqual([ImageName.fromString("cristianrgreco:5000/testcontainer-private:1.1.12")]); diff --git a/packages/testcontainers/src/utils/port-generator.test.ts b/packages/testcontainers/src/utils/port-generator.test.ts index 56d52e122..567f11ee1 100644 --- a/packages/testcontainers/src/utils/port-generator.test.ts +++ b/packages/testcontainers/src/utils/port-generator.test.ts @@ -2,7 +2,7 @@ import { FixedPortGenerator, RandomPortGenerator } from "./port-generator"; describe("PortGenerator", () => { describe("FixedPortGenerator", () => { - it("should return pre-determined ports", async () => { + it.concurrent("should return pre-determined ports", async () => { const fixedPortGenerator = new FixedPortGenerator([1000, 1001]); await expect(fixedPortGenerator.generatePort()).resolves.toBe(1000); @@ -11,7 +11,7 @@ describe("PortGenerator", () => { }); describe("RandomPortGenerator", () => { - it("should generate a random available port", async () => { + it.concurrent("should generate a random available port", async () => { const randomPortGenerator = new RandomPortGenerator(); const port1 = await randomPortGenerator.generatePort(); diff --git a/packages/testcontainers/src/utils/pull-policy.test.ts b/packages/testcontainers/src/utils/pull-policy.test.ts index b12b6f0ca..d5a5dada8 100644 --- a/packages/testcontainers/src/utils/pull-policy.test.ts +++ b/packages/testcontainers/src/utils/pull-policy.test.ts @@ -1,14 +1,14 @@ import { ImagePullPolicy, PullPolicy } from "./pull-policy"; -test("default pull policy should return false", () => { +test.concurrent("default pull policy should return false", () => { expect(PullPolicy.defaultPolicy().shouldPull()).toBe(false); }); -test("always pull policy should return true", () => { +test.concurrent("always pull policy should return true", () => { expect(PullPolicy.alwaysPull().shouldPull()).toBe(true); }); -test("should be able to create a custom pull policy", () => { +test.concurrent("should be able to create a custom pull policy", () => { class CustomPullPolicy implements ImagePullPolicy { public shouldPull(): boolean { return true; diff --git a/packages/testcontainers/src/wait-strategies/composite-wait-strategy.test.ts b/packages/testcontainers/src/wait-strategies/composite-wait-strategy.test.ts index 4c1604c6e..1ad0b55ab 100644 --- a/packages/testcontainers/src/wait-strategies/composite-wait-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/composite-wait-strategy.test.ts @@ -2,7 +2,7 @@ import { GenericContainer } from "../generic-container/generic-container"; import { Wait } from "./wait"; describe("CompositeWaitStrategy", { timeout: 180_000 }, () => { - it("should work with individual timeouts", async () => { + it.concurrent("should work with individual timeouts", async () => { const container = new GenericContainer("cristianrgreco/testcontainer:1.1.14").withWaitStrategy( Wait.forAll([ Wait.forSuccessfulCommand("exit 1").withStartupTimeout(1000), @@ -13,7 +13,7 @@ describe("CompositeWaitStrategy", { timeout: 180_000 }, () => { await expect(container.start()).rejects.toThrowError(`Shell command "exit 2" not successful after 100ms`); }); - it("should work with outer timeout where inner strategy times out", async () => { + it.concurrent("should work with outer timeout where inner strategy times out", async () => { const container = new GenericContainer("cristianrgreco/testcontainer:1.1.14").withWaitStrategy( Wait.forAll([ Wait.forSuccessfulCommand("exit 1"), @@ -24,7 +24,7 @@ describe("CompositeWaitStrategy", { timeout: 180_000 }, () => { await expect(container.start()).rejects.toThrowError(`Shell command "exit 2" not successful after 100ms`); }); - it("should work with outer timeout where outer strategy times out", async () => { + it.concurrent("should work with outer timeout where outer strategy times out", async () => { const container = new GenericContainer("cristianrgreco/testcontainer:1.1.14").withWaitStrategy( Wait.forAll([ Wait.forSuccessfulCommand("exit 1"), @@ -35,7 +35,7 @@ describe("CompositeWaitStrategy", { timeout: 180_000 }, () => { await expect(container.start()).rejects.toThrowError(`Shell command "exit 1" not successful after 100ms`); }); - it("should work with maximum outer timeout", async () => { + it.concurrent("should work with maximum outer timeout", async () => { const container = new GenericContainer("cristianrgreco/testcontainer:1.1.14").withWaitStrategy( Wait.forAll([ Wait.forListeningPorts(), diff --git a/packages/testcontainers/src/wait-strategies/health-check-wait-strategy.test.ts b/packages/testcontainers/src/wait-strategies/health-check-wait-strategy.test.ts index 73a46acf5..0bb47e1a9 100644 --- a/packages/testcontainers/src/wait-strategies/health-check-wait-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/health-check-wait-strategy.test.ts @@ -7,7 +7,7 @@ import { Wait } from "./wait"; const fixtures = path.resolve(__dirname, "..", "..", "fixtures", "docker"); describe("HealthCheckWaitStrategy", { timeout: 180_000 }, () => { - it("should wait for health check", async () => { + it.concurrent("should wait for health check", async () => { const context = path.resolve(fixtures, "docker-with-health-check"); const customGenericContainer = await GenericContainer.fromDockerfile(context).build(); const container = await customGenericContainer @@ -20,7 +20,7 @@ describe("HealthCheckWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should wait for custom health check", async () => { + it.concurrent("should wait for custom health check", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withHealthCheck({ @@ -38,7 +38,7 @@ describe("HealthCheckWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should stop the container when the health check fails", async () => { + it.concurrent("should stop the container when the health check fails", async () => { const containerName = `container-${new RandomUuid().nextUuid()}`; const context = path.resolve(fixtures, "docker-with-health-check"); @@ -55,7 +55,7 @@ describe("HealthCheckWaitStrategy", { timeout: 180_000 }, () => { expect(await getRunningContainerNames()).not.toContain(containerName); }); - it("should stop the container when the health check wait strategy times out", async () => { + it.concurrent("should stop the container when the health check wait strategy times out", async () => { const containerName = `container-${new RandomUuid().nextUuid()}`; const context = path.resolve(fixtures, "docker-with-health-check-with-start-period"); @@ -73,21 +73,24 @@ describe("HealthCheckWaitStrategy", { timeout: 180_000 }, () => { expect(await getRunningContainerNames()).not.toContain(containerName); }); - it("should wait for custom health check using CMD to run the command directly without a shell", async () => { - const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") - .withExposedPorts(8080) - .withHealthCheck({ - test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/hello-world"], - interval: 1000, - timeout: 3000, - retries: 5, - startPeriod: 1000, - }) - .withWaitStrategy(Wait.forHealthCheck()) - .start(); + it.concurrent( + "should wait for custom health check using CMD to run the command directly without a shell", + async () => { + const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") + .withExposedPorts(8080) + .withHealthCheck({ + test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/hello-world"], + interval: 1000, + timeout: 3000, + retries: 5, + startPeriod: 1000, + }) + .withWaitStrategy(Wait.forHealthCheck()) + .start(); - await checkContainerIsHealthy(container); + await checkContainerIsHealthy(container); - await container.stop(); - }); + await container.stop(); + } + ); }); diff --git a/packages/testcontainers/src/wait-strategies/host-port-wait-strategy.test.ts b/packages/testcontainers/src/wait-strategies/host-port-wait-strategy.test.ts index 40de3bcec..fd6de6a4b 100644 --- a/packages/testcontainers/src/wait-strategies/host-port-wait-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/host-port-wait-strategy.test.ts @@ -3,7 +3,7 @@ import { GenericContainer } from "../generic-container/generic-container"; import { checkContainerIsHealthy, getRunningContainerNames } from "../utils/test-helper"; describe("HostPortWaitStrategy", { timeout: 180_000 }, () => { - it("should wait for port", async () => { + it.concurrent("should wait for port", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start(); await checkContainerIsHealthy(container); @@ -11,7 +11,7 @@ describe("HostPortWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should stop the container when the host port check wait strategy times out", async () => { + it.concurrent("should stop the container when the host port check wait strategy times out", async () => { const containerName = `container-${new RandomUuid().nextUuid()}`; await expect( diff --git a/packages/testcontainers/src/wait-strategies/http-wait-strategy.test.ts b/packages/testcontainers/src/wait-strategies/http-wait-strategy.test.ts index 56c2b59f2..6dc898884 100644 --- a/packages/testcontainers/src/wait-strategies/http-wait-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/http-wait-strategy.test.ts @@ -4,7 +4,7 @@ import { checkContainerIsHealthy, checkContainerIsHealthyTls, stopStartingContai import { Wait } from "./wait"; describe("HttpWaitStrategy", { timeout: 180_000 }, () => { - it("should wait for 200", async () => { + it.concurrent("should wait for 200", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forHttp("/hello-world", 8080)) @@ -15,7 +15,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should wait for status code", async () => { + it.concurrent("should wait for status code", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forHttp("/unknown-path", 8080).forStatusCode(404)) @@ -26,7 +26,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should timeout for mismatching status code", async () => { + it.concurrent("should timeout for mismatching status code", async () => { await expect(() => new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -36,7 +36,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { ).rejects.toThrowError("URL /unknown-path not accessible after 3000ms"); }); - it("should wait for status code matching", async () => { + it.concurrent("should wait for status code matching", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy( @@ -51,7 +51,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should timeout for falsy status code matching", async () => { + it.concurrent("should timeout for falsy status code matching", async () => { await expect(() => new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -61,7 +61,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { ).rejects.toThrowError("URL /hello-world not accessible after 3000ms"); }); - it("should wait for response body predicate", async () => { + it.concurrent("should wait for response body predicate", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy( @@ -74,7 +74,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should timeout for falsy response body predicate", async () => { + it.concurrent("should timeout for falsy response body predicate", async () => { await expect(() => new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) @@ -85,7 +85,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { }); describe("when options.abortOnContainerExit is true", () => { - it("should fail if container exited before waiting pass", async () => { + it.concurrent("should fail if container exited before waiting pass", async () => { const name = `container-name-${new RandomUuid().nextUuid()}`; const data = [1, 2, 3]; const tail = 50; @@ -103,7 +103,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { ); }); - it("should log only $tail logs if container exited before waiting pass", async () => { + it.concurrent("should log only $tail logs if container exited before waiting pass", async () => { const name = `container-name-${new RandomUuid().nextUuid()}`; const tail = 50; const data = [...Array(tail + 5).keys()]; @@ -122,7 +122,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { }); }); - it("should set method", async () => { + it.concurrent("should set method", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forHttp("/hello-world-post", 8080).withMethod("POST")) @@ -133,7 +133,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set headers", async () => { + it.concurrent("should set headers", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forHttp("/header-or-400/custom", 8080).withHeaders({ custom: "value" })) @@ -144,7 +144,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set basic credentials", async () => { + it.concurrent("should set basic credentials", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forHttp("/auth", 8080).withBasicCredentials("user", "pass")) @@ -155,7 +155,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should set read timeout", async () => { + it.concurrent("should set read timeout", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forHttp("/hello-world-delay", 8080).withReadTimeout(5000)) @@ -167,7 +167,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { }); describe("should wait for TLS", () => { - it("disallow self-signed certificates", async () => { + it.concurrent("disallow self-signed certificates", async () => { await expect(() => new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8443) @@ -177,7 +177,7 @@ describe("HttpWaitStrategy", { timeout: 180_000 }, () => { ).rejects.toThrow(); }); - it("allow self-signed certificates", async () => { + it.concurrent("allow self-signed certificates", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8443) .withWaitStrategy(Wait.forHttp("/hello-world", 8443).usingTls().allowInsecure()) diff --git a/packages/testcontainers/src/wait-strategies/log-wait-strategy.test.ts b/packages/testcontainers/src/wait-strategies/log-wait-strategy.test.ts index 62e537f0c..ad6dcb52a 100644 --- a/packages/testcontainers/src/wait-strategies/log-wait-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/log-wait-strategy.test.ts @@ -4,7 +4,7 @@ import { checkContainerIsHealthy, getRunningContainerNames } from "../utils/test import { Wait } from "./wait"; describe("LogWaitStrategy", { timeout: 180_000 }, () => { - it("should wait for log", async () => { + it.concurrent("should wait for log", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forLogMessage("Listening on port 8080")) @@ -15,7 +15,7 @@ describe("LogWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should wait for log with regex", async () => { + it.concurrent("should wait for log with regex", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withExposedPorts(8080) .withWaitStrategy(Wait.forLogMessage(/Listening on port \d+/)) @@ -26,7 +26,7 @@ describe("LogWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should wait for a new log after restart", async () => { + it.concurrent("should wait for a new log after restart", async () => { const start = new Date(); const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withCommand(["/bin/sh", "-c", 'sleep 2; echo "Ready"']) @@ -40,7 +40,7 @@ describe("LogWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should stop the container when the log message wait strategy times out", async () => { + it.concurrent("should stop the container when the log message wait strategy times out", async () => { const containerName = `container-${new RandomUuid().nextUuid()}`; await expect( diff --git a/packages/testcontainers/src/wait-strategies/one-shot-startup-startegy.test.ts b/packages/testcontainers/src/wait-strategies/one-shot-startup-startegy.test.ts index dc5ffc347..413441718 100644 --- a/packages/testcontainers/src/wait-strategies/one-shot-startup-startegy.test.ts +++ b/packages/testcontainers/src/wait-strategies/one-shot-startup-startegy.test.ts @@ -2,7 +2,7 @@ import { GenericContainer } from "../generic-container/generic-container"; import { Wait } from "./wait"; describe("OneShotStartupCheckStrategy", { timeout: 180_000 }, () => { - it("should wait for container to finish", async () => { + it.concurrent("should wait for container to finish", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withCommand(["/bin/sh", "-c", 'sleep 2; echo "Ready"']) .withWaitStrategy(Wait.forOneShotStartup()) @@ -11,7 +11,7 @@ describe("OneShotStartupCheckStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should fail if container did not finish succesfully", async () => { + it.concurrent("should fail if container did not finish succesfully", async () => { await expect(() => new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withCommand(["/bin/sh", "-c", "not-existing"]) diff --git a/packages/testcontainers/src/wait-strategies/shell-wait-strategy.test.ts b/packages/testcontainers/src/wait-strategies/shell-wait-strategy.test.ts index 99c87137f..e12cb6159 100644 --- a/packages/testcontainers/src/wait-strategies/shell-wait-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/shell-wait-strategy.test.ts @@ -2,7 +2,7 @@ import { GenericContainer } from "../generic-container/generic-container"; import { Wait } from "./wait"; describe("ShellWaitStrategy", { timeout: 180_000 }, () => { - it("should wait for successful command", async () => { + it.concurrent("should wait for successful command", async () => { const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withCommand(["/bin/sh", "-c", "sleep 0.5; touch /tmp/test.lock; node index.js"]) .withWaitStrategy(Wait.forSuccessfulCommand("stat /tmp/test.lock")) @@ -11,7 +11,7 @@ describe("ShellWaitStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should timeout when command not successful", async () => { + it.concurrent("should timeout when command not successful", async () => { await expect(() => new GenericContainer("cristianrgreco/testcontainer:1.1.14") .withWaitStrategy(Wait.forSuccessfulCommand("stat /tmp/test.lock")) diff --git a/packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts b/packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts index 99f7931a9..f3ad7a9a2 100644 --- a/packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts +++ b/packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts @@ -2,7 +2,7 @@ import { GenericContainer } from "../generic-container/generic-container"; import { StartupCheckStrategy, StartupStatus } from "./startup-check-strategy"; describe("StartupCheckStrategy", { timeout: 180_000 }, () => { - it("should wait until ready", async () => { + it.concurrent("should wait until ready", async () => { const waitStrategy = new (class extends StartupCheckStrategy { private count = 0; @@ -23,7 +23,7 @@ describe("StartupCheckStrategy", { timeout: 180_000 }, () => { await container.stop(); }); - it("should fail when status PENDING after timeout", async () => { + it.concurrent("should fail when status PENDING after timeout", async () => { const waitStrategy = new (class extends StartupCheckStrategy { public override async checkStartupState(): Promise { return "PENDING"; @@ -38,7 +38,7 @@ describe("StartupCheckStrategy", { timeout: 180_000 }, () => { ).rejects.toThrowError("Container not accessible after 3000ms"); }); - it("should fail immediately when status FAILED", async () => { + it.concurrent("should fail immediately when status FAILED", async () => { const waitStrategy = new (class extends StartupCheckStrategy { public count = 0; diff --git a/packages/testcontainers/src/wait-strategies/utils/port-check.test.ts b/packages/testcontainers/src/wait-strategies/utils/port-check.test.ts index 54808a760..be17c6f22 100644 --- a/packages/testcontainers/src/wait-strategies/utils/port-check.test.ts +++ b/packages/testcontainers/src/wait-strategies/utils/port-check.test.ts @@ -36,7 +36,7 @@ describe("PortCheck", () => { mockLogger.enabled.mockImplementation(() => true); }); - it("should return true when at least one command returns exit code 0", async () => { + it.concurrent("should return true when at least one command returns exit code 0", async () => { mockContainerExec .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 1 })) @@ -47,7 +47,7 @@ describe("PortCheck", () => { expect(result).toBe(true); }); - it("should trace log unique error messages", async () => { + it.concurrent("should trace log unique error messages", async () => { mockContainerExec .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 1 })) @@ -61,7 +61,7 @@ describe("PortCheck", () => { ]); }); - it("should trace log unique error messages across multiple invocations", async () => { + it.concurrent("should trace log unique error messages across multiple invocations", async () => { mockContainerExec .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 1 })) @@ -79,7 +79,7 @@ describe("PortCheck", () => { ]); }); - it("should not trace log error messages with empty output", async () => { + it.concurrent("should not trace log error messages with empty output", async () => { mockContainerExec .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) @@ -92,20 +92,23 @@ describe("PortCheck", () => { ]); }); - it("should not trace log error messages where the shell is missing if another shell exists", async () => { - mockContainerExec - .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) - .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) - .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 126 })); + it.concurrent( + "should not trace log error messages where the shell is missing if another shell exists", + async () => { + mockContainerExec + .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) + .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 1 })) + .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 126 })); - await portCheck.isBound(8080); + await portCheck.isBound(8080); - expect(mockLogger.trace.mock.calls).toEqual([ - ["Port check result exit code 1: ERROR 1", { containerId: "containerId" }], - ]); - }); + expect(mockLogger.trace.mock.calls).toEqual([ + ["Port check result exit code 1: ERROR 1", { containerId: "containerId" }], + ]); + } + ); - it("should error log when the port-check will fail due to missing shells (distroless)", async () => { + it.concurrent("should error log when the port-check will fail due to missing shells (distroless)", async () => { mockContainerExec .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 126 })) .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 126 })) @@ -121,7 +124,7 @@ describe("PortCheck", () => { ]); }); - it("should error log the distroless image once", async () => { + it.concurrent("should error log the distroless image once", async () => { mockContainerExec .mockReturnValueOnce(Promise.resolve({ output: "ERROR 1", exitCode: 126 })) .mockReturnValueOnce(Promise.resolve({ output: "ERROR 2", exitCode: 126 })) @@ -141,7 +144,7 @@ describe("PortCheck", () => { ]); }); - it("should error log the distroless image once, regardless of logs enabled or not", async () => { + it.concurrent("should error log the distroless image once, regardless of logs enabled or not", async () => { // Make sure logging is disabled explicitly here mockLogger.enabled.mockImplementation(() => false); diff --git a/packages/testcontainers/src/wait-strategies/utils/undici-response-parser.test.ts b/packages/testcontainers/src/wait-strategies/utils/undici-response-parser.test.ts index 1e07f3999..fab6fc095 100644 --- a/packages/testcontainers/src/wait-strategies/utils/undici-response-parser.test.ts +++ b/packages/testcontainers/src/wait-strategies/utils/undici-response-parser.test.ts @@ -3,7 +3,7 @@ import { Dispatcher } from "undici"; import BodyReadable from "undici/types/readable"; import { undiciResponseToFetchResponse } from "./undici-response-parser"; -test("converts undici response to fetch response", async () => { +test.concurrent("converts undici response to fetch response", async () => { const responseData: Partial = { statusCode: 200, headers: { "content-type": "application/json" }, @@ -17,7 +17,7 @@ test("converts undici response to fetch response", async () => { await expect(response.text()).resolves.toBe('{"key":"value"}'); }); -test("handles empty headers", async () => { +test.concurrent("handles empty headers", async () => { const responseData: Partial = { statusCode: 200, body: createBody(), @@ -28,7 +28,7 @@ test("handles empty headers", async () => { expect(response.headers).toEqual(new Headers()); }); -test("handles a header array", async () => { +test.concurrent("handles a header array", async () => { const responseData: Partial = { statusCode: 200, headers: {