mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(lambda): clean up hot reload functions (#5205)
* test(lambda): clean up hot reload functions * test(lambda): preserve creation failures during cleanup
This commit is contained in:
1 parent
13738f89de
commit
43c616d757
1 file changed
+9
-4
+9
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user