Skip to content
2 changes: 2 additions & 0 deletions images/runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ COPY src/main/c/libfnunixsocket.so /function/runtime/lib/

RUN ["/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java", "-Xshare:dump"]

RUN addgroup --system --gid 1000 fn && adduser --uid 1000 --gid 1000 fn

# UseCGroupMemoryLimitForHeap looks up /sys/fs/cgroup/memory/memory.limit_in_bytes inside the container to determine
# what the heap should be set to. This is an experimental feature at the moment, thus we need to unlock to use it.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class FlowTest {
public void shouldInvokeBasicFlow() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/flowBasic").rewritePOM();
tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
tc.runFn("config", "app", tc.appName(), "COMPLETER_BASE_URL", testRule.getFlowURL());
CmdResult r = tc.runFnWithInput("1", "invoke", tc.appName(), "flowbasic");
assertThat(r.getStdout()).isEqualTo("4");
Expand All @@ -37,7 +37,7 @@ public void shouldInvokeBasicFlow() throws Exception {
public void shouldInvokeBasicFlowJDK8() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/flowBasicJDK8").rewritePOM();
tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
tc.runFn("config", "app", tc.appName(), "COMPLETER_BASE_URL", testRule.getFlowURL());
CmdResult r = tc.runFnWithInput("1", "invoke", tc.appName(), "flowbasicj8");
assertThat(r.getStdout()).isEqualTo("4");
Expand All @@ -48,7 +48,7 @@ public void shouldInvokeBasicFlowJDK8() throws Exception {
public void shouldExerciseAllFlow() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/flowAllFeatures").rewritePOM();
tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
tc.runFn("config", "app", tc.appName(), "COMPLETER_BASE_URL", testRule.getFlowURL());
CmdResult r = tc.runFnWithInput("1", "invoke", tc.appName(), "flowallfeatures");
assertThat(r.getStdout()).contains("Everything worked");
Expand All @@ -73,8 +73,7 @@ public void shouldCallExitHooks() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/flowExitHooks").rewritePOM();
tc.runFn("--verbose", "build", "--no-cache");

tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
tc.runFn("config", "app", tc.appName(), "COMPLETER_BASE_URL", testRule.getFlowURL());
tc.runFn("config", "app", tc.appName(), "TERMINATION_HOOK_URL", "http://" + testRule.getDockerLocalhost() + ":" + 8000 + "/exited");
CmdResult r = tc.runFnWithInput("1", "invoke", tc.appName(), "flowexithooks");
Expand All @@ -92,7 +91,7 @@ public void shouldCallExitHooks() throws Exception {
public void shouldHandleTimeouts() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/flowTimeouts").rewritePOM();
tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
tc.runFn("config", "app", tc.appName(), "COMPLETER_BASE_URL", testRule.getFlowURL());
CmdResult r = tc.runFn("invoke", tc.appName(), "flowtimeouts");
assertThat(r.getStdout()).contains("timeout");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void shouldCallExistingFn() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/simpleFunc").rewritePOM();

tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
tc.runFn("config", "app", tc.appName(), "GREETING", "Salutations");

CmdResult r1 = tc.runFnWithInput("", "invoke", tc.appName(), "simplefunc");
Expand All @@ -46,12 +46,11 @@ public void shouldCallExistingFn() throws Exception {
@Test()
public void checkBoilerPlate() throws Exception {
for (String runtime : new String[]{"java8", "java11"}) {
IntegrationTestRule.TestContext tc = testRule.newTest();

IntegrationTestRule.TestContext tc = testRule.newTest();
String fnName = "bp" + runtime;
tc.runFn("init", "--runtime", runtime, "--name", fnName);
tc.rewritePOM();
tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");
CmdResult rs = tc.runFnWithInput("wibble", "invoke", tc.appName(), fnName);
assertThat(rs.getStdout()).contains("Hello, wibble!");
}
Expand All @@ -67,8 +66,7 @@ public static class InspectResponse {
public void shouldHandleTrigger() throws Exception {
IntegrationTestRule.TestContext tc = testRule.newTest();
tc.withDirFrom("funcs/httpgwfunc").rewritePOM();

tc.runFn("--verbose", "deploy", "--app", tc.appName(), "--local");
tc.runFn("--verbose", "deploy", "--create-app", "--app", tc.appName(), "--local");

// Get me the trigger URL
CmdResult output = tc.runFn("inspect", "trigger", tc.appName(), "httpgwfunc", "trig");
Expand Down