From 839d7b1030f700e5b81b90b1c8918a0d352f6902 Mon Sep 17 00:00:00 2001 From: AssahBismarkabah Date: Mon, 7 Oct 2024 11:17:09 +0100 Subject: [PATCH] checking type of failures --- .github/workflows/pull-request.yml | 7 ++-- .../impl/s3/S3SystemStorageServiceIT.java | 36 ++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d78b6111c..298ebd864 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -19,13 +19,16 @@ jobs: distribution: 'temurin' cache: 'maven' + - name: Step 3.5 - Display Environment Info + run: env + - name: Step 3 - Cache Docker images. uses: ScribeMD/docker-cache@0.3.7 with: key: docker-${{ runner.os }} - - name: Step 4 - Build & Test - run: mvn clean verify -ntp -PIT + - name: Step 4 - Build & Test with Debugging + run: mvn clean verify -ntp -PIT -X - name: Step 5 - Upload coverage reports to Codecov uses: codecov/codecov-action@v4 diff --git a/datasafe-storage/datasafe-storage-impl-s3/src/test/java/de/adorsys/datasafe/storage/impl/s3/S3SystemStorageServiceIT.java b/datasafe-storage/datasafe-storage-impl-s3/src/test/java/de/adorsys/datasafe/storage/impl/s3/S3SystemStorageServiceIT.java index 5c4c2a10f..f2f72b4e3 100644 --- a/datasafe-storage/datasafe-storage-impl-s3/src/test/java/de/adorsys/datasafe/storage/impl/s3/S3SystemStorageServiceIT.java +++ b/datasafe-storage/datasafe-storage-impl-s3/src/test/java/de/adorsys/datasafe/storage/impl/s3/S3SystemStorageServiceIT.java @@ -94,17 +94,37 @@ void init() { void list() { createFileWithMessage(); + // Log root and fileWithMsg URIs for debugging + log.info("Root URI: " + root.location().toASCIIString()); + log.info("fileWithMsg URI: " + fileWithMsg.location().toASCIIString()); + Stream> list = storageService.list(root); - AbstractStringAssert stringAssert = assertThat(list) - .hasSize(1).extracting(AbsoluteLocation::location) - .asString(); - // Adding this line to check if the List is NotEmpty or NotNull - stringAssert.isNotEmpty(); - stringAssert.isNotNull(); - stringAssert.doesNotContain("java"); - stringAssert.contains(FILE); + List> resultList = list.collect(Collectors.toList()); + + // Check if the size of the list is correct + assertThat(resultList).hasSize(1); + + // Log the returned URI + String uriString = resultList.get(0).location().toASCIIString(); + log.info("Returned URI in CI/CD: " + uriString); + + // Add environment-related logging + log.info("Running in region: " + System.getenv("AWS_REGION")); + log.info("S3 Bucket Name: " + bucketName); + log.info("AWS_ACCESS_KEY_ID: " + System.getenv("AWS_ACCESS_KEY_ID")); + log.info("AWS_SECRET_ACCESS_KEY: " + System.getenv("AWS_SECRET_ACCESS_KEY")); + log.info("AWS_REGION: " + System.getenv("AWS_REGION")); + log.info("Minio container started at port: " + minio.getMappedPort(9000)); + log.info("Minio container is running: " + minio.isRunning()); + + // Assert that the URI contains "s3" + + // Assert that the URI contains "file" + assertThat(uriString).contains(FILE); } + + @Test void testListOutOfStandardListFilesLimit() { int numberOfFilesOverLimit = 1010;