From 5cdbb4962e4890616901d09a6b6d2c1428343d43 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Fri, 5 Apr 2024 13:18:09 +0200 Subject: [PATCH 1/3] feat(uiExtension): extend UI manifest file properties --- pkg/c8y/uiExtension.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/c8y/uiExtension.go b/pkg/c8y/uiExtension.go index 36ebfe19..46c5e5de 100644 --- a/pkg/c8y/uiExtension.go +++ b/pkg/c8y/uiExtension.go @@ -35,12 +35,17 @@ func (m *UIManifest) WithPackage(v string) *UIManifest { type UIManifestFile struct { Name string `json:"name,omitempty"` - Version string `json:"version,omitempty"` Key string `json:"key,omitempty"` ContextPath string `json:"contextPath,omitempty"` - Description string `json:"description,omitempty"` Package string `json:"package,omitempty"` IsPackage bool `json:"isPackage,omitempty"` + Version string `json:"version,omitempty"` + + Author string `json:"author"` + Description string `json:"description,omitempty"` + License string `json:"license"` + Remotes map[string][]string `json:"remotes"` + RequiredPlatformVersion string `json:"requiredPlatformVersion"` } const CumulocityUIManifestFile = "cumulocity.json" From 24e727d59b9e372a95eeeeea298b973c4416a3a2 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Fri, 5 Apr 2024 13:30:55 +0200 Subject: [PATCH 2/3] add small delay before checking if measurements exist --- test/c8y_test/measurement_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/c8y_test/measurement_test.go b/test/c8y_test/measurement_test.go index 89300dc3..035c52b8 100644 --- a/test/c8y_test/measurement_test.go +++ b/test/c8y_test/measurement_test.go @@ -400,6 +400,8 @@ func TestMeasurementService_DeleteMeasurements(t *testing.T) { ValueFragmentType: valueFragmentType, } + // Wait for measurements to be created + time.Sleep(2 * time.Second) measCol1, resp, err := client.Measurement.GetMeasurements( context.Background(), searchOptions, From d6dd0a74b64a2c20c73ccb627e98751727af1958 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Fri, 5 Apr 2024 13:40:30 +0200 Subject: [PATCH 3/3] test: use unique measurement type to prevent side effects across test instances --- test/c8y_test/measurement_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/c8y_test/measurement_test.go b/test/c8y_test/measurement_test.go index 035c52b8..6aa37d06 100644 --- a/test/c8y_test/measurement_test.go +++ b/test/c8y_test/measurement_test.go @@ -381,7 +381,7 @@ func TestMeasurementService_DeleteMeasurements(t *testing.T) { testDevice, err := createRandomTestDevice() testingutils.Ok(t, err) - valueFragmentType := "nx_Type1" + valueFragmentType := "nx_Type1_" + testingutils.RandomString(5) createMeasVariable1 := measurementFactory(client, testDevice.ID, valueFragmentType, "Variable1") createMeasVariable2 := measurementFactory(client, testDevice.ID, valueFragmentType, "Variable2") @@ -422,6 +422,7 @@ func TestMeasurementService_DeleteMeasurements(t *testing.T) { // Check that the measurements have been removed // Check by requesting the new collection again as retrieving single measurements // is no longer supported by Cumulocity IoT + time.Sleep(2 * time.Second) // give server some time to delete the measurements measColAfter, resp, err := client.Measurement.GetMeasurements( context.Background(), searchOptions,