From b466c579bb7ef740379486a839cf35475f119621 Mon Sep 17 00:00:00 2001 From: Tommy Situ Date: Fri, 18 Jan 2019 12:23:14 +0000 Subject: [PATCH] Update regex in the tests to allow rc version --- core/hoverfly_service_test.go | 4 ++-- functional-tests/core/api/hoverfly_api_v2_test.go | 2 +- functional-tests/core/api/version_api_v2_test.go | 2 +- functional-tests/hoverctl/import_export_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/hoverfly_service_test.go b/core/hoverfly_service_test.go index 2678de4cb..a57651706 100644 --- a/core/hoverfly_service_test.go +++ b/core/hoverfly_service_test.go @@ -123,7 +123,7 @@ func Test_Hoverfly_GetSimulation_ReturnsBlankSimulation_ifThereIsNoData(t *testi Expect(simulation.GlobalActions.Delays).To(HaveLen(0)) Expect(simulation.MetaView.SchemaVersion).To(Equal("v5")) - Expect(simulation.MetaView.HoverflyVersion).To(MatchRegexp(`v\d+.\d+.\d+`)) + Expect(simulation.MetaView.HoverflyVersion).To(MatchRegexp(`v\d+.\d+.\d+(-rc.\d)*`)) Expect(simulation.MetaView.TimeExported).ToNot(BeNil()) } @@ -420,7 +420,7 @@ func Test_Hoverfly_GetFilteredSimulation_ReturnBlankSimulation_IfThereIsNoMatch( Expect(simulation.GlobalActions.DelaysLogNormal).To(HaveLen(0)) Expect(simulation.MetaView.SchemaVersion).To(Equal("v5")) - Expect(simulation.MetaView.HoverflyVersion).To(MatchRegexp(`v\d+.\d+.\d+`)) + Expect(simulation.MetaView.HoverflyVersion).To(MatchRegexp(`v\d+.\d+.\d+(-rc.\d)*`)) Expect(simulation.MetaView.TimeExported).ToNot(BeNil()) } diff --git a/functional-tests/core/api/hoverfly_api_v2_test.go b/functional-tests/core/api/hoverfly_api_v2_test.go index 0a19382e5..6b40c34b2 100644 --- a/functional-tests/core/api/hoverfly_api_v2_test.go +++ b/functional-tests/core/api/hoverfly_api_v2_test.go @@ -37,7 +37,7 @@ var _ = Describe("/api/v2/hoverfly", func() { Expect(hoverflyJson).To(MatchRegexp(`"destination":"."`)) Expect(hoverflyJson).To(MatchRegexp(`"middleware":{"binary":"","script":"","remote":""}`)) Expect(hoverflyJson).To(MatchRegexp(`"usage":{"counters":{"capture":0,"diff":0,"modify":0,"simulate":0,"spy":0,"synthesize":0}}`)) - Expect(hoverflyJson).To(MatchRegexp(`"version":"v\d+.\d+.\d+"`)) + Expect(hoverflyJson).To(MatchRegexp(`"version":"v\d+.\d+.\d+(-rc.\d)*"`)) Expect(hoverflyJson).To(MatchRegexp(`"upstreamProxy":""`)) Expect(hoverflyJson).To(MatchRegexp(`"mode":"simulate","arguments":{"matchingStrategy":"strongest"}`)) }) diff --git a/functional-tests/core/api/version_api_v2_test.go b/functional-tests/core/api/version_api_v2_test.go index bdd5fc893..f36998d23 100644 --- a/functional-tests/core/api/version_api_v2_test.go +++ b/functional-tests/core/api/version_api_v2_test.go @@ -32,7 +32,7 @@ var _ = Describe("/api/v2/hoverfly/version", func() { Expect(res.StatusCode).To(Equal(200)) modeJson, err := ioutil.ReadAll(res.Body) Expect(err).To(BeNil()) - Expect(string(modeJson)).To(MatchRegexp(`{"version":"v\d+.\d+.\d+"}`)) + Expect(string(modeJson)).To(MatchRegexp(`{"version":"v\d+.\d+.\d+(-rc.\d)*"}`)) }) }) }) diff --git a/functional-tests/hoverctl/import_export_test.go b/functional-tests/hoverctl/import_export_test.go index 67cc38861..65a3f6c14 100644 --- a/functional-tests/hoverctl/import_export_test.go +++ b/functional-tests/hoverctl/import_export_test.go @@ -184,7 +184,7 @@ var _ = Describe("When I use hoverctl", func() { hoverflySimulation = `"pairs":[{"request":{"path":[{"matcher":"exact","value":"/api/bookings"}],"method":[{"matcher":"exact","value":"POST"}],"destination":[{"matcher":"exact","value":"www.my-test.com"}],"scheme":[{"matcher":"exact","value":"http"}],"body":[{"matcher":"exact","value":"{\"flightId\": \"1\"}"}],"headers":{"Content-Type":[{"matcher":"exact","value":"application/json"}]}},"response":{"status":201,"body":"","encodedBody":false,"headers":{"Location":["http://localhost/api/bookings/1"]},"templated":false}}],"globalActions":{"delays":[],"delaysLogNormal":[]}}` - hoverflyMeta = `"meta":{"schemaVersion":"v5","hoverflyVersion":"v\d+.\d+.\d+","timeExported":` + hoverflyMeta = `"meta":{"schemaVersion":"v5","hoverflyVersion":"v\d+.\d+.\d+(-rc.\d)*","timeExported":` ) Describe("with a running hoverfly", func() {