From 43c616d7577e48e59be4d534b33f5f247ab79dd6 Mon Sep 17 00:00:00 2001 From: Aniket Shukla Date: Thu, 8 Oct 2026 02:20:27 +0530 Subject: [PATCH] test(lambda): clean up hot reload functions (#5205) * test(lambda): clean up hot reload functions * test(lambda): preserve creation failures during cleanup --- .../LambdaHotReloadAllowListIntegrationTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/test/java/io/github/hectorvent/floci/services/lambda/LambdaHotReloadAllowListIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/lambda/LambdaHotReloadAllowListIntegrationTest.java index f54a35a58a..db32270ba9 100644 --- a/src/test/java/io/github/hectorvent/floci/services/lambda/LambdaHotReloadAllowListIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/lambda/LambdaHotReloadAllowListIntegrationTest.java @@ -20,8 +20,7 @@ class LambdaHotReloadAllowListIntegrationTest { private static int counter; - private static ValidatableResponse createFunction(String s3Key) { - String name = "hot-reload-allow-list-" + (++counter); + private static ValidatableResponse createFunction(String name, String s3Key) { return given() .contentType("application/json") .body(""" @@ -46,7 +45,7 @@ class LambdaHotReloadAllowListIntegrationTest { "/home/ci/code:/etc" }) void createFunctionRejectsPathsOutsideTheAllowedDirectory(String s3Key) { - createFunction(s3Key) + createFunction("hot-reload-allow-list-" + (++counter), s3Key) .statusCode(400) .body("__type", equalTo("InvalidParameterValueException")); } @@ -54,6 +53,12 @@ class LambdaHotReloadAllowListIntegrationTest { @ParameterizedTest @ValueSource(strings = {"/home/ci/code", "/home/ci/code/app"}) void createFunctionAcceptsTheAllowedDirectoryAndItsChildren(String s3Key) { - createFunction(s3Key).statusCode(201); + String name = "hot-reload-allow-list-" + (++counter); + createFunction(name, s3Key).statusCode(201); + given() + .when() + .delete("/2015-03-31/functions/{name}", name) + .then() + .statusCode(204); } }