Skip to content

Commit

Permalink
checking type of failures
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Oct 7, 2024
1 parent 75346ae commit 839d7b1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AbsoluteLocation<ResolvedResource>> 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<AbsoluteLocation<ResolvedResource>> 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;
Expand Down

0 comments on commit 839d7b1

Please sign in to comment.