From 3f8d5bed3ee6917812cc6f9b81b22b5254017065 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Fri, 3 Nov 2023 13:40:40 -0400 Subject: [PATCH] fix some tests --- test/local-build.test.w | 2 +- test/microservices.test.w | 11 +++++++---- test/util.test.w | 4 ---- test/values.test.w | 6 ------ 4 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 test/util.test.w delete mode 100644 test/values.test.w diff --git a/test/local-build.test.w b/test/local-build.test.w index 79ce1db..f7a750f 100644 --- a/test/local-build.test.w +++ b/test/local-build.test.w @@ -9,7 +9,7 @@ let app = new containers.Workload( ); test "can access container" { - let response = http.get("${app.url()}"); + let response = http.get("${app.publicUrl}"); if let body = response.body { log(body); } diff --git a/test/microservices.test.w b/test/microservices.test.w index abcec5a..46fb4b6 100644 --- a/test/microservices.test.w +++ b/test/microservices.test.w @@ -1,6 +1,7 @@ bring "../containers.w" as containers; bring cloud; bring http; +bring expect; let producer = new containers.Workload( name: "producer", @@ -18,11 +19,13 @@ let consumer = new containers.Workload( } ) as "consumer"; -new cloud.Function(inflight () => { - if let url = consumer.url() { +test "send request" { + if let url = consumer.publicUrl { log("get ${url}..."); if let body = http.get(url).body { - log(body); + expect.equal(body, Json.stringify({ producer_result: { result: 12 } })); + } else { + assert(false); } } -}) as "send request"; \ No newline at end of file +} diff --git a/test/util.test.w b/test/util.test.w deleted file mode 100644 index 4ad153c..0000000 --- a/test/util.test.w +++ /dev/null @@ -1,4 +0,0 @@ -bring "../utils.w" as utils; - -let hash = utils.contentHash(["*/**"], "test/my-app"); -assert(hash == "c50686c1a1d3007bf0f21838dec40eb4"); diff --git a/test/values.test.w b/test/values.test.w deleted file mode 100644 index d05e935..0000000 --- a/test/values.test.w +++ /dev/null @@ -1,6 +0,0 @@ -bring "../tf-aws/values.w" as values; -bring util; - -if let x = values.tryGet("foo") { - log(x); -} \ No newline at end of file