From 7b84e4b04358a5375ff80a553850b678279c8a15 Mon Sep 17 00:00:00 2001 From: shahzad31 Date: Wed, 19 Jul 2023 22:31:31 +0200 Subject: [PATCH] upate tets --- .../common/runtime_types/monitor_management/locations.ts | 4 ++-- .../monitor_management/synthetics_private_locations.ts | 4 +++- .../apis/synthetics/services/private_location_test_service.ts | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts index 170893c06a385..263bc0e8dcb15 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/locations.ts @@ -38,8 +38,8 @@ export const BandwidthLimitKeyCodec = tEnum( export type BandwidthLimitKeyType = t.TypeOf; export const LocationGeoCodec = t.interface({ - lat: t.union([t.null, t.number]), - lon: t.union([t.null, t.number]), + lat: t.union([t.string, t.number]), + lon: t.union([t.string, t.number]), }); export const LocationStatusCodec = tEnum('LocationStatus', LocationStatus); diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts index 240fcc7efab18..5b0d12579b5cb 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts @@ -18,7 +18,9 @@ export const PrivateLocationCodec = t.intersection([ isServiceManaged: t.boolean, isInvalid: t.boolean, tags: t.array(t.string), - geo: t.interface({ lat: t.union([t.null, t.number]), lon: t.union([t.null, t.number]) }), + /* Empty Lat lon was accidentally saved as an empty string instead of undefined or null + * Need a migration to fix */ + geo: t.interface({ lat: t.union([t.string, t.number]), lon: t.union([t.string, t.number]) }), }), ]); diff --git a/x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts b/x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts index 1ba2c05f8d79c..380b908515b4c 100644 --- a/x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts +++ b/x-pack/test/api_integration/apis/synthetics/services/private_location_test_service.ts @@ -65,6 +65,7 @@ export class PrivateLocationTestService { lon: '', }, concurrentMonitors: 1, + isServiceManaged: false, })); await server.savedObjects.create({