From 830c5df4d662091f062ac9725063d67ec223ec5b Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Wed, 16 Sep 2026 15:09:52 -0600 Subject: [PATCH 1/2] Add integration tests.yml for hello function Two test cases for the hello handler covering the happy path (valid name, expects 200 + greeting) and the error case (missing name, expects 400 + error message). These are integration tests for the new foundry functions test command (CLI 2.1.0+), which runs them against the deployed function. --- functions/hello/tests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 functions/hello/tests.yml diff --git a/functions/hello/tests.yml b/functions/hello/tests.yml new file mode 100644 index 0000000..6ac5662 --- /dev/null +++ b/functions/hello/tests.yml @@ -0,0 +1,19 @@ +tests: + - handler: hello + cases: + - name: valid_name + input: + body: + name: "Foundry" + expect: + status: 200 + body: + greeting: "Hello Foundry! It is nice to see you." + + - name: missing_name + input: + body: {} + expect: + status: 400 + errors: + - "missing name from request body" From 80526cd4aa971ea2f7e22ee0b29ad65357ab491d Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Wed, 16 Sep 2026 15:20:55 -0600 Subject: [PATCH 2/2] Add integration tests.yml for host-details function Three test cases: valid host ID (placeholder, replace with a real AID), missing host_id (400), and invalid host ID (404). Shows how to test a function that calls the FalconPy Hosts API. --- functions/host-details/tests.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 functions/host-details/tests.yml diff --git a/functions/host-details/tests.yml b/functions/host-details/tests.yml new file mode 100644 index 0000000..ac08f91 --- /dev/null +++ b/functions/host-details/tests.yml @@ -0,0 +1,24 @@ +tests: + - handler: host-details + cases: + - name: valid_host_id + input: + body: + host_id: "YOUR_HOST_AID_HERE" + expect: + status: 200 + + - name: missing_host_id + input: + body: {} + expect: + status: 400 + errors: + - "missing host_id from request body" + + - name: invalid_host_id + input: + body: + host_id: "does_not_exist" + expect: + status: 404