From cc192e415ebd0eeb7fe24321479b8895ff6808ce Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 29 Sep 2025 10:52:55 +0200 Subject: [PATCH 01/38] texture_id replacing texture_filename --- components/Viewer/Options/TextureItem.vue | 12 ++++++------ components/Viewer/Options/TexturesSelector.vue | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/Viewer/Options/TextureItem.vue b/components/Viewer/Options/TextureItem.vue index 588f7cbe..de722bd7 100644 --- a/components/Viewer/Options/TextureItem.vue +++ b/components/Viewer/Options/TextureItem.vue @@ -43,14 +43,14 @@ const props = defineProps({ id: { type: String, required: true }, texture_name: { type: String, required: true }, - texture_file_name: { type: String, required: true }, + texture_id: { type: String, required: true }, }) const texture_name = ref("") texture_name.value = props.texture_name - const texture_file_name = ref("") - texture_file_name.value = props.texture_file_name + const texture_id = ref("") + texture_id.value = props.texture_id const texture_coordinates = ref([]) @@ -86,7 +86,7 @@ }, { response_function: async (response) => { - texture_file_name.value = response._data.viewable_file_name + texture_id.value = response._data.id }, }, ) @@ -97,8 +97,8 @@ emit("update_value", { key: "texture_name", value }) }) - watch(texture_file_name, (value) => { - emit("update_value", { key: "texture_file_name", value }) + watch(texture_id, (value) => { + emit("update_value", { key: "id", value }) }) diff --git a/components/Viewer/Options/TexturesSelector.vue b/components/Viewer/Options/TexturesSelector.vue index 66ec8517..7a97b935 100644 --- a/components/Viewer/Options/TexturesSelector.vue +++ b/components/Viewer/Options/TexturesSelector.vue @@ -18,7 +18,7 @@ @@ -31,7 +31,7 @@ v-tooltip:bottom="'Add a texture'" size="20" @click=" - internal_textures.push({ texture_name: '', texture_file_name: '' }) + internal_textures.push({ texture_name: '', id: '' }) " /> @@ -51,14 +51,14 @@ if (textures.value != null) { internal_textures.value = textures.value } else { - internal_textures.value = [{ texture_name: "", texture_file_name: "" }] + internal_textures.value = [{ texture_name: "", id: "" }] } }) function update_value_event($event, index) { internal_textures.value[index][$event.key] = $event.value const filtered = internal_textures.value.filter((texture) => { - return texture.texture_name != "" && texture.texture_file_name != "" + return texture.texture_name != "" && texture.id != "" }) if (filtered.length != 0) { textures.value = filtered From 615c3aca02936e12268671d8b5e6288e994547a5 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 29 Sep 2025 11:02:42 +0200 Subject: [PATCH 02/38] fix(applytexture): Since database added, texture_id is required. From bcb582c1b602013e704784a2b2701c5bca52cc6c Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Mon, 29 Sep 2025 09:03:59 +0000 Subject: [PATCH 03/38] Apply prepare changes --- components/Viewer/Options/TexturesSelector.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/Viewer/Options/TexturesSelector.vue b/components/Viewer/Options/TexturesSelector.vue index 7a97b935..0356353c 100644 --- a/components/Viewer/Options/TexturesSelector.vue +++ b/components/Viewer/Options/TexturesSelector.vue @@ -30,9 +30,7 @@ icon="mdi-plus" v-tooltip:bottom="'Add a texture'" size="20" - @click=" - internal_textures.push({ texture_name: '', id: '' }) - " + @click="internal_textures.push({ texture_name: '', id: '' })" /> From d59cb456713b1da66e0e18ddcf7616b0909dbdcd Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Tue, 30 Sep 2025 15:57:29 +0200 Subject: [PATCH 04/38] removed file_name from registerObject function --- stores/data_base.js | 4 ++-- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index 5026ac8c..bf0de9ca 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id, file_name, viewer_object) { + async function registerObject(id, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id, file_name, viewer_object }, + params: { id, viewer_object }, }) } async function addItem( diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 7900bda4..39c49622 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -54,7 +54,6 @@ afterAll(() => { }) const id = "fake_id" -const file_name = "edged_curve.vtp" const geode_object = "EdgedCurve2D" const object_type = "mesh" From 0d30ab9acebf273e7cb05a6dbbf61e5d839db596 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 17:43:22 +0200 Subject: [PATCH 05/38] mypy --- components/Viewer/Options/TextureItem.vue | 2 +- components/Viewer/Options/TexturesSelector.vue | 6 +++--- stores/data_base.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/Viewer/Options/TextureItem.vue b/components/Viewer/Options/TextureItem.vue index de722bd7..8f1d5757 100644 --- a/components/Viewer/Options/TextureItem.vue +++ b/components/Viewer/Options/TextureItem.vue @@ -42,8 +42,8 @@ const props = defineProps({ id: { type: String, required: true }, - texture_name: { type: String, required: true }, texture_id: { type: String, required: true }, + texture_name: { type: String, required: true }, }) const texture_name = ref("") diff --git a/components/Viewer/Options/TexturesSelector.vue b/components/Viewer/Options/TexturesSelector.vue index 0356353c..1dac4b9a 100644 --- a/components/Viewer/Options/TexturesSelector.vue +++ b/components/Viewer/Options/TexturesSelector.vue @@ -49,16 +49,16 @@ if (textures.value != null) { internal_textures.value = textures.value } else { - internal_textures.value = [{ texture_name: "", id: "" }] + internal_textures.value = [{ id: "", texture_name: "" }] } }) function update_value_event($event, index) { internal_textures.value[index][$event.key] = $event.value const filtered = internal_textures.value.filter((texture) => { - return texture.texture_name != "" && texture.id != "" + return texture.texture_name !== "" && texture.id !== "" }) - if (filtered.length != 0) { + if (filtered.length !== 0) { textures.value = filtered } } diff --git a/stores/data_base.js b/stores/data_base.js index bf0de9ca..71b2fc8a 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,7 +42,7 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id, viewer_object) { + function registerObject(id, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, params: { id, viewer_object }, From 4a3b09b08dbf7c46b6a6171f24cec05b99e9b0a5 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Wed, 1 Oct 2025 15:44:05 +0000 Subject: [PATCH 06/38] Apply prepare changes --- .oxlintrc.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 79c1bdc1..58e3b153 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -7,5 +7,29 @@ "style": "error", "restriction": "error" }, - "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"] + "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"], + "rules": { + "unicorn/filename-case": [ + "error", + { + "case": "snakeCase" + } + ], + "eslint/func-style": [ + "error", + { + "style:": "declaration" + } + ], + "eslint/sort-keys": "off", + "eslint/no-ternary": "off" + }, + "overrides": [ + { + "files": ["**/components/*"], + "rules": { + "unicorn/filename-case": "PascalCase" + } + } + ] } From afcd104abcc801f5beaf40696c516fb140a4feb8 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 18:19:29 +0200 Subject: [PATCH 07/38] test --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 1938ded1..4fca8000 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -56,6 +56,7 @@ afterAll(() => { const id = "fake_id" const geode_object = "EdgedCurve2D" const object_type = "mesh" +const file_name = "edged_curve.vtp" beforeEach(async () => { const pinia = createTestingPinia({ @@ -82,10 +83,10 @@ beforeEach(async () => { viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - await dataBaseStore.registerObject(id, file_name, object_type) + await dataBaseStore.registerObject(id, file_name) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}, 15000) +}, 30000) describe("Mesh edges", () => { afterEach(async () => { From 65a0ca944e99bf05c036c1ff4df244cbfac53344 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 19:09:04 +0200 Subject: [PATCH 08/38] test --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 4fca8000..39c49622 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -56,7 +56,6 @@ afterAll(() => { const id = "fake_id" const geode_object = "EdgedCurve2D" const object_type = "mesh" -const file_name = "edged_curve.vtp" beforeEach(async () => { const pinia = createTestingPinia({ @@ -83,10 +82,10 @@ beforeEach(async () => { viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - await dataBaseStore.registerObject(id, file_name) + await dataBaseStore.registerObject(id, file_name, object_type) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}, 30000) +}) describe("Mesh edges", () => { afterEach(async () => { From 103a4019a3ef42bed5def96d76da3693c4736024 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 19:18:18 +0200 Subject: [PATCH 09/38] test --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 39c49622..835d4f84 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -54,6 +54,7 @@ afterAll(() => { }) const id = "fake_id" +const file_name = "edged_curve.vtp" const geode_object = "EdgedCurve2D" const object_type = "mesh" @@ -85,7 +86,7 @@ beforeEach(async () => { await dataBaseStore.registerObject(id, file_name, object_type) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}) +}, 15000) describe("Mesh edges", () => { afterEach(async () => { From 077c20e8994077efc4985bf94215cb975b4022a0 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 19:28:49 +0200 Subject: [PATCH 10/38] test --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 835d4f84..703ec8df 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -22,6 +22,7 @@ import { } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" +import appMode from "@ogw_f/utils/app_mode" import * as composables from "@ogw_f/composables/viewer_call" import { useDataStyleStore } from "@ogw_f/stores/data_style" @@ -68,7 +69,7 @@ beforeEach(async () => { const dataBaseStore = useDataBaseStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() - infraStore.app_mode = appMode.appMode.BROWSER + infraStore.app_mode = appMode.BROWSER const viewer_path = path.join( executable_path( @@ -83,10 +84,10 @@ beforeEach(async () => { viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - await dataBaseStore.registerObject(id, file_name, object_type) + await dataBaseStore.registerObject(id, object_type) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}, 15000) +}, 30000) describe("Mesh edges", () => { afterEach(async () => { From 94a4340a1323ecdf4a6ec60626e3c862e5814f92 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 19:42:20 +0200 Subject: [PATCH 11/38] test --- stores/data_base.js | 4 ++-- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index 71b2fc8a..5026ac8c 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - function registerObject(id, viewer_object) { + async function registerObject(id, file_name, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id, viewer_object }, + params: { id, file_name, viewer_object }, }) } async function addItem( diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 703ec8df..835d4f84 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -22,7 +22,6 @@ import { } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" -import appMode from "@ogw_f/utils/app_mode" import * as composables from "@ogw_f/composables/viewer_call" import { useDataStyleStore } from "@ogw_f/stores/data_style" @@ -69,7 +68,7 @@ beforeEach(async () => { const dataBaseStore = useDataBaseStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() - infraStore.app_mode = appMode.BROWSER + infraStore.app_mode = appMode.appMode.BROWSER const viewer_path = path.join( executable_path( @@ -84,10 +83,10 @@ beforeEach(async () => { viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - await dataBaseStore.registerObject(id, object_type) + await dataBaseStore.registerObject(id, file_name, object_type) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}, 30000) +}, 15000) describe("Mesh edges", () => { afterEach(async () => { From 917f90417179ee48d4ecaadd1c5ca0d032d9cabf Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 23:21:09 +0200 Subject: [PATCH 12/38] test --- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 835d4f84..a204233e 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -22,6 +22,7 @@ import { } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" +import appMode from "@ogw_f/utils/app_mode" import * as composables from "@ogw_f/composables/viewer_call" import { useDataStyleStore } from "@ogw_f/stores/data_style" @@ -68,26 +69,43 @@ beforeEach(async () => { const dataBaseStore = useDataBaseStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() - infraStore.app_mode = appMode.appMode.BROWSER - - const viewer_path = path.join( - executable_path( - path.join("tests", "integration", "microservices", "viewer"), - ), - executable_name("opengeodeweb_viewer"), - ) - const viewer_port = await run_viewer(viewer_path, { - port: 1234, - data_folder_path: path.join(__dirname, "..", "..", "..", "data"), + + infraStore.app_mode = appMode.BROWSER + + vi.spyOn(composables, "viewer_call").mockResolvedValue({ _data: {} }) + viewerStore.default_local_port = 1234 + viewerStore.status = Status.CONNECTED + + await dataBaseStore.addItem(id, { + object_type, + geode_object, + native_filename: file_name, + viewable_filename: file_name, + displayed_name: file_name, + vtk_js: { binary_light_viewable: null }, }) - viewerStore.default_local_port = viewer_port - await viewerStore.ws_connect() - await dataBaseStore.registerObject(id, file_name, object_type) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) }, 15000) +const viewer_path = path.join( + executable_path( + path.join("tests", "integration", "microservices", "viewer"), + ), + executable_name("opengeodeweb_viewer"), +) +const viewer_port = await run_viewer(viewer_path, { + port: 1234, + data_folder_path: path.join(__dirname, "..", "..", "..", "data"), +}) + +viewerStore.default_local_port = viewer_port +await viewerStore.ws_connect() +await dataBaseStore.registerObject(id, file_name, object_type) +await dataStyleStore.addDataStyle(id, geode_object, object_type) +expect(viewerStore.status).toBe(Status.CONNECTED) + describe("Mesh edges", () => { afterEach(async () => { await kill_processes() From f37f789d9e092989bc2bd336f1060d849a92c159 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Wed, 1 Oct 2025 21:22:09 +0000 Subject: [PATCH 13/38] Apply prepare changes --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index a204233e..5dcbba07 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -90,9 +90,7 @@ beforeEach(async () => { }, 15000) const viewer_path = path.join( - executable_path( - path.join("tests", "integration", "microservices", "viewer"), - ), + executable_path(path.join("tests", "integration", "microservices", "viewer")), executable_name("opengeodeweb_viewer"), ) const viewer_port = await run_viewer(viewer_path, { From 1c757d0396a4eaa987d9d404127b87fe611db493 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 23:45:31 +0200 Subject: [PATCH 14/38] test --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index a204233e..250884b3 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -87,7 +87,7 @@ beforeEach(async () => { await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}, 15000) +}, 30000) const viewer_path = path.join( executable_path( From 764524c8494039307fab1d6fb2406a1857a4c182 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 1 Oct 2025 23:55:50 +0200 Subject: [PATCH 15/38] test --- tests/integration/microservices/viewer/requirements.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration/microservices/viewer/requirements.in b/tests/integration/microservices/viewer/requirements.in index e69de29b..9d8ce846 100644 --- a/tests/integration/microservices/viewer/requirements.in +++ b/tests/integration/microservices/viewer/requirements.in @@ -0,0 +1,4 @@ +fastjsonschema +opengeodeweb-viewer +wslink +vtk \ No newline at end of file From b658d11da6af188b14731abdf921b1c21119df50 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Wed, 1 Oct 2025 21:57:03 +0000 Subject: [PATCH 16/38] Apply prepare changes --- .../microservices/viewer/requirements.txt | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index c8397d70..32645aa0 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -4,3 +4,163 @@ # # pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt --pre tests/integration/microservices/viewer/requirements.in # +aiohappyeyeballs==2.*,>=2.6.1 + # via + # aiohttp + # opengeodeweb-viewer +aiohttp==3.*,>=3.12.15 + # via + # opengeodeweb-viewer + # wslink +aiosignal==1.*,>=1.4.0 + # via + # aiohttp + # opengeodeweb-viewer +attrs==25.*,>=25.3.0 + # via + # aiohttp + # opengeodeweb-viewer +blinker==1.*,>=1.9.0 + # via + # flask + # opengeodeweb-microservice + # opengeodeweb-viewer +click==8.*,>=8.3.0 + # via + # flask + # opengeodeweb-microservice + # opengeodeweb-viewer +contourpy==1.*,>=1.3.3 + # via + # matplotlib + # opengeodeweb-viewer +cycler==0.*,>=0.12.1 + # via + # matplotlib + # opengeodeweb-viewer +fastjsonschema==2.*,>=2.21.1 + # via + # -r tests/integration/microservices/viewer/requirements.in + # opengeodeweb-microservice + # opengeodeweb-viewer +flask==3.*,>=3.1.2 + # via + # flask-sqlalchemy + # opengeodeweb-microservice + # opengeodeweb-viewer +flask-sqlalchemy==3.*,>=3.1.1 + # via + # opengeodeweb-microservice + # opengeodeweb-viewer +fonttools==4.*,>=4.60.1 + # via + # matplotlib + # opengeodeweb-viewer +frozenlist==1.*,>=1.7.0 + # via + # aiohttp + # aiosignal + # opengeodeweb-viewer +greenlet==3.*,>=3.2.4 + # via + # opengeodeweb-microservice + # opengeodeweb-viewer + # sqlalchemy +idna==3.10 + # via + # opengeodeweb-viewer + # yarl +itsdangerous==2.*,>=2.2.0 + # via + # flask + # opengeodeweb-microservice + # opengeodeweb-viewer +jinja2==3.*,>=3.1.6 + # via + # flask + # opengeodeweb-microservice + # opengeodeweb-viewer +kiwisolver==1.4.10rc0 + # via + # matplotlib + # opengeodeweb-viewer +markupsafe==3.*,>=3.0.2 + # via + # flask + # jinja2 + # opengeodeweb-microservice + # opengeodeweb-viewer + # werkzeug +matplotlib==3.*,>=3.10.6 + # via + # opengeodeweb-viewer + # vtk +multidict==6.*,>=6.6.4 + # via + # aiohttp + # opengeodeweb-viewer + # yarl +numpy==2.*,>=2.3.3 + # via + # contourpy + # matplotlib + # opengeodeweb-viewer +opengeodeweb-microservice==1.0.1rc1 + # via opengeodeweb-viewer +opengeodeweb-viewer==1.11.0rc9 + # via -r tests/integration/microservices/viewer/requirements.in +packaging==25.0 + # via + # matplotlib + # opengeodeweb-viewer +pillow==11.*,>=11.3.0 + # via + # matplotlib + # opengeodeweb-viewer +propcache==0.*,>=0.3.2 + # via + # aiohttp + # opengeodeweb-viewer + # yarl +pyparsing==3.3.0a1 + # via + # matplotlib + # opengeodeweb-viewer +python-dateutil==2.9.0.post0 + # via + # matplotlib + # opengeodeweb-viewer +six==1.*,>=1.17.0 + # via + # opengeodeweb-viewer + # python-dateutil +sqlalchemy==2.*,>=2.0.43 + # via + # flask-sqlalchemy + # opengeodeweb-microservice + # opengeodeweb-viewer +typing-extensions==4.*,>=4.15.0 + # via + # aiosignal + # opengeodeweb-microservice + # opengeodeweb-viewer + # sqlalchemy +vtk==9.*,>=9.5.2 + # via + # -r tests/integration/microservices/viewer/requirements.in + # opengeodeweb-viewer +websocket-client==1.*,>=1.8.0 + # via opengeodeweb-viewer +werkzeug==3.*,>=3.1.3 + # via + # flask + # opengeodeweb-microservice + # opengeodeweb-viewer +wslink==1.*,>=1.12.4 + # via + # -r tests/integration/microservices/viewer/requirements.in + # opengeodeweb-viewer +yarl==1.*,>=1.20.1 + # via + # aiohttp + # opengeodeweb-viewer From 9f6554e877a1bd90ca94246aeab8c6d812a6d3c1 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 2 Oct 2025 09:44:59 +0200 Subject: [PATCH 17/38] revert --- .../viewer/requirements-internal.in | 2 +- .../microservices/viewer/requirements.in | 4 -- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 46 ++++++------------- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/tests/integration/microservices/viewer/requirements-internal.in b/tests/integration/microservices/viewer/requirements-internal.in index 38e41704..452ecb74 100644 --- a/tests/integration/microservices/viewer/requirements-internal.in +++ b/tests/integration/microservices/viewer/requirements-internal.in @@ -1 +1 @@ -opengeodeweb-viewer[cpu] \ No newline at end of file +opengeodeweb-viewer \ No newline at end of file diff --git a/tests/integration/microservices/viewer/requirements.in b/tests/integration/microservices/viewer/requirements.in index 9d8ce846..e69de29b 100644 --- a/tests/integration/microservices/viewer/requirements.in +++ b/tests/integration/microservices/viewer/requirements.in @@ -1,4 +0,0 @@ -fastjsonschema -opengeodeweb-viewer -wslink -vtk \ No newline at end of file diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 52df4989..835d4f84 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -22,7 +22,6 @@ import { } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" -import appMode from "@ogw_f/utils/app_mode" import * as composables from "@ogw_f/composables/viewer_call" import { useDataStyleStore } from "@ogw_f/stores/data_style" @@ -69,40 +68,25 @@ beforeEach(async () => { const dataBaseStore = useDataBaseStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() - - infraStore.app_mode = appMode.BROWSER - - vi.spyOn(composables, "viewer_call").mockResolvedValue({ _data: {} }) - viewerStore.default_local_port = 1234 - viewerStore.status = Status.CONNECTED - - await dataBaseStore.addItem(id, { - object_type, - geode_object, - native_filename: file_name, - viewable_filename: file_name, - displayed_name: file_name, - vtk_js: { binary_light_viewable: null }, + infraStore.app_mode = appMode.appMode.BROWSER + + const viewer_path = path.join( + executable_path( + path.join("tests", "integration", "microservices", "viewer"), + ), + executable_name("opengeodeweb_viewer"), + ) + const viewer_port = await run_viewer(viewer_path, { + port: 1234, + data_folder_path: path.join(__dirname, "..", "..", "..", "data"), }) + viewerStore.default_local_port = viewer_port + await viewerStore.ws_connect() + await dataBaseStore.registerObject(id, file_name, object_type) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) -}, 30000) - -const viewer_path = path.join( - executable_path(path.join("tests", "integration", "microservices", "viewer")), - executable_name("opengeodeweb_viewer"), -) -const viewer_port = await run_viewer(viewer_path, { - port: 1234, - data_folder_path: path.join(__dirname, "..", "..", "..", "data"), -}) - -viewerStore.default_local_port = viewer_port -await viewerStore.ws_connect() -await dataBaseStore.registerObject(id, file_name, object_type) -await dataStyleStore.addDataStyle(id, geode_object, object_type) -expect(viewerStore.status).toBe(Status.CONNECTED) +}, 15000) describe("Mesh edges", () => { afterEach(async () => { From 41470f8d950fd0847885b1346361c2563eb9dab5 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Thu, 2 Oct 2025 07:46:02 +0000 Subject: [PATCH 18/38] Apply prepare changes --- .../microservices/viewer/requirements.txt | 160 ------------------ 1 file changed, 160 deletions(-) diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index 32645aa0..c8397d70 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -4,163 +4,3 @@ # # pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt --pre tests/integration/microservices/viewer/requirements.in # -aiohappyeyeballs==2.*,>=2.6.1 - # via - # aiohttp - # opengeodeweb-viewer -aiohttp==3.*,>=3.12.15 - # via - # opengeodeweb-viewer - # wslink -aiosignal==1.*,>=1.4.0 - # via - # aiohttp - # opengeodeweb-viewer -attrs==25.*,>=25.3.0 - # via - # aiohttp - # opengeodeweb-viewer -blinker==1.*,>=1.9.0 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -click==8.*,>=8.3.0 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -contourpy==1.*,>=1.3.3 - # via - # matplotlib - # opengeodeweb-viewer -cycler==0.*,>=0.12.1 - # via - # matplotlib - # opengeodeweb-viewer -fastjsonschema==2.*,>=2.21.1 - # via - # -r tests/integration/microservices/viewer/requirements.in - # opengeodeweb-microservice - # opengeodeweb-viewer -flask==3.*,>=3.1.2 - # via - # flask-sqlalchemy - # opengeodeweb-microservice - # opengeodeweb-viewer -flask-sqlalchemy==3.*,>=3.1.1 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer -fonttools==4.*,>=4.60.1 - # via - # matplotlib - # opengeodeweb-viewer -frozenlist==1.*,>=1.7.0 - # via - # aiohttp - # aiosignal - # opengeodeweb-viewer -greenlet==3.*,>=3.2.4 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer - # sqlalchemy -idna==3.10 - # via - # opengeodeweb-viewer - # yarl -itsdangerous==2.*,>=2.2.0 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -jinja2==3.*,>=3.1.6 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -kiwisolver==1.4.10rc0 - # via - # matplotlib - # opengeodeweb-viewer -markupsafe==3.*,>=3.0.2 - # via - # flask - # jinja2 - # opengeodeweb-microservice - # opengeodeweb-viewer - # werkzeug -matplotlib==3.*,>=3.10.6 - # via - # opengeodeweb-viewer - # vtk -multidict==6.*,>=6.6.4 - # via - # aiohttp - # opengeodeweb-viewer - # yarl -numpy==2.*,>=2.3.3 - # via - # contourpy - # matplotlib - # opengeodeweb-viewer -opengeodeweb-microservice==1.0.1rc1 - # via opengeodeweb-viewer -opengeodeweb-viewer==1.11.0rc9 - # via -r tests/integration/microservices/viewer/requirements.in -packaging==25.0 - # via - # matplotlib - # opengeodeweb-viewer -pillow==11.*,>=11.3.0 - # via - # matplotlib - # opengeodeweb-viewer -propcache==0.*,>=0.3.2 - # via - # aiohttp - # opengeodeweb-viewer - # yarl -pyparsing==3.3.0a1 - # via - # matplotlib - # opengeodeweb-viewer -python-dateutil==2.9.0.post0 - # via - # matplotlib - # opengeodeweb-viewer -six==1.*,>=1.17.0 - # via - # opengeodeweb-viewer - # python-dateutil -sqlalchemy==2.*,>=2.0.43 - # via - # flask-sqlalchemy - # opengeodeweb-microservice - # opengeodeweb-viewer -typing-extensions==4.*,>=4.15.0 - # via - # aiosignal - # opengeodeweb-microservice - # opengeodeweb-viewer - # sqlalchemy -vtk==9.*,>=9.5.2 - # via - # -r tests/integration/microservices/viewer/requirements.in - # opengeodeweb-viewer -websocket-client==1.*,>=1.8.0 - # via opengeodeweb-viewer -werkzeug==3.*,>=3.1.3 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -wslink==1.*,>=1.12.4 - # via - # -r tests/integration/microservices/viewer/requirements.in - # opengeodeweb-viewer -yarl==1.*,>=1.20.1 - # via - # aiohttp - # opengeodeweb-viewer From 175f53ac514cbd0ebf916803847843d956e5813f Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 2 Oct 2025 14:15:21 +0200 Subject: [PATCH 19/38] test inc --- stores/data_base.js | 4 ++-- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index 5026ac8c..bf0de9ca 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id, file_name, viewer_object) { + async function registerObject(id, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id, file_name, viewer_object }, + params: { id, viewer_object }, }) } async function addItem( diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 835d4f84..6cad17b5 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -54,7 +54,7 @@ afterAll(() => { }) const id = "fake_id" -const file_name = "edged_curve.vtp" +// const file_name = "edged_curve.vtp" const geode_object = "EdgedCurve2D" const object_type = "mesh" From a0a3cf2f107f9f28d13952095a090bbc5dda0bf6 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 2 Oct 2025 16:53:07 +0200 Subject: [PATCH 20/38] data_base updated for mesh_component JSON schema update --- stores/data_base.js | 5 +---- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index bf0de9ca..72e39d2c 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -76,14 +76,11 @@ export const useDataBaseStore = defineStore("dataBase", () => { } async function fetchMeshComponents(id) { - const { native_filename, geode_object } = itemMetaDatas(id) await api_fetch( { schema: back_schemas.opengeodeweb_back.models.mesh_components, params: { - id, - filename: native_filename, - geode_object, + id }, }, { diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 6cad17b5..835d4f84 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -54,7 +54,7 @@ afterAll(() => { }) const id = "fake_id" -// const file_name = "edged_curve.vtp" +const file_name = "edged_curve.vtp" const geode_object = "EdgedCurve2D" const object_type = "mesh" From 9689829d65509775bbc222e8476f34741358e957 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:53:52 +0000 Subject: [PATCH 21/38] Apply prepare changes --- stores/data_base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stores/data_base.js b/stores/data_base.js index 72e39d2c..ef5d8924 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -80,7 +80,7 @@ export const useDataBaseStore = defineStore("dataBase", () => { { schema: back_schemas.opengeodeweb_back.models.mesh_components, params: { - id + id, }, }, { From f8de0375d3bdf0325682caddfda63cb75cb0cd7b Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 3 Oct 2025 09:21:34 +0200 Subject: [PATCH 22/38] stable ? mesh_component --- stores/data_base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index 72e39d2c..262cfdf9 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id, viewer_object) { + async function registerObject(id, file_name, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id, viewer_object }, + params: { id, file_name, viewer_object }, }) } async function addItem( From d63442a9de9e41df4eaf20dd6791606be5e0f861 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 3 Oct 2025 10:26:56 +0200 Subject: [PATCH 23/38] schema.route to schema.$id in viewer.call --- composables/viewer_call.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composables/viewer_call.js b/composables/viewer_call.js index 8939820e..7c6e306e 100644 --- a/composables/viewer_call.js +++ b/composables/viewer_call.js @@ -13,8 +13,8 @@ export function viewer_call( console.log("schema", schema) console.log("params", params) } - feedback_store.add_error(400, schema.route, "Bad request", error) - throw new Error(schema.route.concat(": ", error)) + feedback_store.add_error(400, schema.$id, "Bad request", error) + throw new Error(schema.$id.concat(": ", error)) } const client = viewer_store.client @@ -45,7 +45,7 @@ export function viewer_call( .catch((error) => { feedback_store.add_error( error.code, - schema.route, + schema.$id, error.message, error.message, ) From affa376a9bb258bc1ec78a4022c0324d4bb83828 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 3 Oct 2025 10:32:26 +0200 Subject: [PATCH 24/38] test --- stores/data_base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index c1e76b52..ef5d8924 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id, file_name, viewer_object) { + async function registerObject(id, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id, file_name, viewer_object }, + params: { id, viewer_object }, }) } async function addItem( From 80c987da2e7e4bc11b610d3883aa58384ff80af6 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 3 Oct 2025 13:36:43 +0200 Subject: [PATCH 25/38] registerObject whit id only --- stores/data_base.js | 4 ++-- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index ef5d8924..452fa434 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id, viewer_object) { + async function registerObject(id) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id, viewer_object }, + params: { id }, }) } async function addItem( diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 835d4f84..db44dd65 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -54,7 +54,7 @@ afterAll(() => { }) const id = "fake_id" -const file_name = "edged_curve.vtp" +// const file_name = "edged_curve.vtp" const geode_object = "EdgedCurve2D" const object_type = "mesh" @@ -83,7 +83,8 @@ beforeEach(async () => { viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - await dataBaseStore.registerObject(id, file_name, object_type) + + await dataBaseStore.registerObject(id) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) }, 15000) From a62c5be106c79a7967c0957afd3d934274f61019 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Fri, 3 Oct 2025 11:37:26 +0000 Subject: [PATCH 26/38] Apply prepare changes --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index db44dd65..0a0d75b1 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -83,7 +83,7 @@ beforeEach(async () => { viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - + await dataBaseStore.registerObject(id) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) From e9c850a3edacd8365faad2237f9bd8fe1307e3a3 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 3 Oct 2025 15:20:59 +0200 Subject: [PATCH 27/38] waiting room for refacto web server from Vease-Back --- tests/integration/data/fake_id/test.og_edc2d | Bin 0 -> 573 bytes .../microservices/back/requirements.txt | 103 +++++++++++++++++- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 24 +++- 3 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 tests/integration/data/fake_id/test.og_edc2d diff --git a/tests/integration/data/fake_id/test.og_edc2d b/tests/integration/data/fake_id/test.og_edc2d new file mode 100644 index 0000000000000000000000000000000000000000..362c7b355813a942def39129b9efc6fc23275906 GIT binary patch literal 573 zcmZQ%WMpCl0VYOv1_lOZ;nbA$)Z+NWqWsdll=!mLqLS1KW~H#iqRhmkoK(k>lA_F{ z(vnnHkSa&8qA;);uo(;t?2Jr6Qy3VSz!cC>2nR$lLd2NB6eANeLX%al-DO znOCyo9qfL7_DS97};P$H07ns!21OhQ agCYimL2&}YpjZK6kYZ*=E=ER9Miu~|kdJ`? literal 0 HcmV?d00001 diff --git a/tests/integration/microservices/back/requirements.txt b/tests/integration/microservices/back/requirements.txt index 68675c6c..f9309731 100644 --- a/tests/integration/microservices/back/requirements.txt +++ b/tests/integration/microservices/back/requirements.txt @@ -2,5 +2,106 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --output-file=tests/integration/microservices/back/requirements.txt --pre tests/integration/microservices/back/requirements.in +# pip-compile --pre requirements-internal.in # +asgiref==3.9.2 + # via + # flask + # opengeodeweb-back +blinker==1.9.0 + # via + # flask + # opengeodeweb-back + # opengeodeweb-microservice +click==8.3.0 + # via + # flask + # opengeodeweb-back + # opengeodeweb-microservice +fastjsonschema==2.21.1 + # via + # opengeodeweb-back + # opengeodeweb-microservice +flask[async]==3.1.2 + # via + # flask-cors + # flask-sqlalchemy + # opengeodeweb-back + # opengeodeweb-microservice +flask-cors==6.0.1 + # via opengeodeweb-back +flask-sqlalchemy==3.1.1 + # via + # opengeodeweb-back + # opengeodeweb-microservice +geode-common==33.11.0 + # via + # geode-viewables + # opengeodeweb-back +geode-viewables==3.3.0 + # via opengeodeweb-back +greenlet==3.2.4 + # via + # opengeodeweb-back + # opengeodeweb-microservice + # sqlalchemy +itsdangerous==2.2.0 + # via + # flask + # opengeodeweb-back + # opengeodeweb-microservice +jinja2==3.1.6 + # via + # flask + # opengeodeweb-back + # opengeodeweb-microservice +markupsafe==3.0.3 + # via + # flask + # jinja2 + # opengeodeweb-back + # opengeodeweb-microservice + # werkzeug +opengeode-core==15.27.4 + # via + # geode-common + # geode-viewables + # opengeode-geosciences + # opengeode-geosciencesio + # opengeode-inspector + # opengeode-io + # opengeodeweb-back +opengeode-geosciences==9.4.1 + # via + # geode-viewables + # opengeode-geosciencesio + # opengeodeweb-back +opengeode-geosciencesio==5.8.0 + # via opengeodeweb-back +opengeode-inspector==6.8.1 + # via opengeodeweb-back +opengeode-io==7.4.0 + # via + # geode-viewables + # opengeode-geosciencesio + # opengeodeweb-back +opengeodeweb-back==5.10.2 + # via -r requirements-internal.in +opengeodeweb-microservice==1.0.3 + # via opengeodeweb-back +sqlalchemy==2.0.43 + # via + # flask-sqlalchemy + # opengeodeweb-back + # opengeodeweb-microservice +typing-extensions==4.15.0 + # via + # opengeodeweb-back + # opengeodeweb-microservice + # sqlalchemy +werkzeug==3.1.3 + # via + # flask + # flask-cors + # opengeodeweb-back + # opengeodeweb-microservice diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index db44dd65..c60a46e9 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -54,9 +54,8 @@ afterAll(() => { }) const id = "fake_id" -// const file_name = "edged_curve.vtp" +const file_name = "test.og_edc2d" const geode_object = "EdgedCurve2D" -const object_type = "mesh" beforeEach(async () => { const pinia = createTestingPinia({ @@ -66,24 +65,41 @@ beforeEach(async () => { setActivePinia(pinia) const dataStyleStore = useDataStyleStore() const dataBaseStore = useDataBaseStore() + const geodeStore = useDataBaseStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() infraStore.app_mode = appMode.appMode.BROWSER + const back_path = path.join( + executable_path( + path.join("tests", "integration", "microservices", "back"), + ), + executable_name("opengeodeweb_back"), + ) const viewer_path = path.join( executable_path( path.join("tests", "integration", "microservices", "viewer"), ), executable_name("opengeodeweb_viewer"), ) + const data_folder_path= path.join(__dirname, "..", "..", "..", "data") + const back_port = await run_back(back_path, { + port: 5000, + data_folder_path, + }) const viewer_port = await run_viewer(viewer_path, { port: 1234, - data_folder_path: path.join(__dirname, "..", "..", "..", "data"), + data_folder_path }) - + geodeStore.default_local_port = back_port viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() + const params= { + input_geode_object: geode_object, + filename:file_name, + } + await api_fetch({ schema: back_schemas.opengeodeweb_back.save_viewable_file, params }) await dataBaseStore.registerObject(id) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) From 04fe971f75a99917929236bb2067a092d3baf906 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:20:53 +0000 Subject: [PATCH 28/38] Apply prepare changes --- .../microservices/back/requirements.txt | 103 +----------- .../microservices/viewer/requirements.txt | 157 +----------------- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 19 ++- 3 files changed, 12 insertions(+), 267 deletions(-) diff --git a/tests/integration/microservices/back/requirements.txt b/tests/integration/microservices/back/requirements.txt index f9309731..68675c6c 100644 --- a/tests/integration/microservices/back/requirements.txt +++ b/tests/integration/microservices/back/requirements.txt @@ -2,106 +2,5 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --pre requirements-internal.in +# pip-compile --output-file=tests/integration/microservices/back/requirements.txt --pre tests/integration/microservices/back/requirements.in # -asgiref==3.9.2 - # via - # flask - # opengeodeweb-back -blinker==1.9.0 - # via - # flask - # opengeodeweb-back - # opengeodeweb-microservice -click==8.3.0 - # via - # flask - # opengeodeweb-back - # opengeodeweb-microservice -fastjsonschema==2.21.1 - # via - # opengeodeweb-back - # opengeodeweb-microservice -flask[async]==3.1.2 - # via - # flask-cors - # flask-sqlalchemy - # opengeodeweb-back - # opengeodeweb-microservice -flask-cors==6.0.1 - # via opengeodeweb-back -flask-sqlalchemy==3.1.1 - # via - # opengeodeweb-back - # opengeodeweb-microservice -geode-common==33.11.0 - # via - # geode-viewables - # opengeodeweb-back -geode-viewables==3.3.0 - # via opengeodeweb-back -greenlet==3.2.4 - # via - # opengeodeweb-back - # opengeodeweb-microservice - # sqlalchemy -itsdangerous==2.2.0 - # via - # flask - # opengeodeweb-back - # opengeodeweb-microservice -jinja2==3.1.6 - # via - # flask - # opengeodeweb-back - # opengeodeweb-microservice -markupsafe==3.0.3 - # via - # flask - # jinja2 - # opengeodeweb-back - # opengeodeweb-microservice - # werkzeug -opengeode-core==15.27.4 - # via - # geode-common - # geode-viewables - # opengeode-geosciences - # opengeode-geosciencesio - # opengeode-inspector - # opengeode-io - # opengeodeweb-back -opengeode-geosciences==9.4.1 - # via - # geode-viewables - # opengeode-geosciencesio - # opengeodeweb-back -opengeode-geosciencesio==5.8.0 - # via opengeodeweb-back -opengeode-inspector==6.8.1 - # via opengeodeweb-back -opengeode-io==7.4.0 - # via - # geode-viewables - # opengeode-geosciencesio - # opengeodeweb-back -opengeodeweb-back==5.10.2 - # via -r requirements-internal.in -opengeodeweb-microservice==1.0.3 - # via opengeodeweb-back -sqlalchemy==2.0.43 - # via - # flask-sqlalchemy - # opengeodeweb-back - # opengeodeweb-microservice -typing-extensions==4.15.0 - # via - # opengeodeweb-back - # opengeodeweb-microservice - # sqlalchemy -werkzeug==3.1.3 - # via - # flask - # flask-cors - # opengeodeweb-back - # opengeodeweb-microservice diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index e58ef870..c8397d70 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -2,160 +2,5 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements-internal.in tests/integration/microservices/viewer/requirements.in +# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt --pre tests/integration/microservices/viewer/requirements.in # -aiohappyeyeballs~=2.6 - # via - # aiohttp - # opengeodeweb-viewer -aiohttp~=3.12 - # via - # opengeodeweb-viewer - # wslink -aiosignal~=1.4 - # via - # aiohttp - # opengeodeweb-viewer -attrs~=25.3 - # via - # aiohttp - # opengeodeweb-viewer -blinker~=1.9 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -click~=8.3 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -contourpy~=1.3 - # via - # matplotlib - # opengeodeweb-viewer -cycler~=0.12 - # via - # matplotlib - # opengeodeweb-viewer -fastjsonschema~=2.21 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer -flask~=3.1 - # via - # flask-sqlalchemy - # opengeodeweb-microservice - # opengeodeweb-viewer -flask-sqlalchemy~=3.1 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer -fonttools~=4.60 - # via - # matplotlib - # opengeodeweb-viewer -frozenlist~=1.7 - # via - # aiohttp - # aiosignal - # opengeodeweb-viewer -greenlet~=3.2 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer - # sqlalchemy -idna==3.10 - # via - # opengeodeweb-viewer - # yarl -itsdangerous~=2.2 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -jinja2~=3.1 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -kiwisolver~=1.4 - # via - # matplotlib - # opengeodeweb-viewer -markupsafe~=3.0 - # via - # flask - # jinja2 - # opengeodeweb-microservice - # opengeodeweb-viewer - # werkzeug -matplotlib~=3.10 - # via - # opengeodeweb-viewer - # vtk -multidict~=6.6 - # via - # aiohttp - # opengeodeweb-viewer - # yarl -numpy~=2.3 - # via - # contourpy - # matplotlib - # opengeodeweb-viewer -opengeodeweb-microservice~=1.0 - # via opengeodeweb-viewer -opengeodeweb-viewer[cpu]~=1.11 - # via -r tests/integration/microservices/viewer/requirements-internal.in -packaging==25.0 - # via - # matplotlib - # opengeodeweb-viewer -pillow~=11.3 - # via - # matplotlib - # opengeodeweb-viewer -propcache~=0.3 - # via - # aiohttp - # opengeodeweb-viewer - # yarl -pyparsing~=3.2 - # via - # matplotlib - # opengeodeweb-viewer -python-dateutil==2.9.0.post0 - # via - # matplotlib - # opengeodeweb-viewer -six~=1.17 - # via - # opengeodeweb-viewer - # python-dateutil -sqlalchemy~=2.0 - # via - # flask-sqlalchemy - # opengeodeweb-microservice - # opengeodeweb-viewer -typing-extensions~=4.15 - # via - # aiosignal - # opengeodeweb-microservice - # opengeodeweb-viewer - # sqlalchemy -vtk~=9.5 - # via opengeodeweb-viewer -websocket-client~=1.8 - # via opengeodeweb-viewer -werkzeug~=3.1 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -wslink~=1.12 - # via opengeodeweb-viewer -yarl~=1.20 - # via - # aiohttp - # opengeodeweb-viewer diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index c60a46e9..fa28c8ab 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -71,9 +71,7 @@ beforeEach(async () => { infraStore.app_mode = appMode.appMode.BROWSER const back_path = path.join( - executable_path( - path.join("tests", "integration", "microservices", "back"), - ), + executable_path(path.join("tests", "integration", "microservices", "back")), executable_name("opengeodeweb_back"), ) const viewer_path = path.join( @@ -82,24 +80,27 @@ beforeEach(async () => { ), executable_name("opengeodeweb_viewer"), ) - const data_folder_path= path.join(__dirname, "..", "..", "..", "data") + const data_folder_path = path.join(__dirname, "..", "..", "..", "data") const back_port = await run_back(back_path, { port: 5000, data_folder_path, }) const viewer_port = await run_viewer(viewer_path, { port: 1234, - data_folder_path + data_folder_path, }) geodeStore.default_local_port = back_port viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() - - const params= { + + const params = { input_geode_object: geode_object, - filename:file_name, + filename: file_name, } - await api_fetch({ schema: back_schemas.opengeodeweb_back.save_viewable_file, params }) + await api_fetch({ + schema: back_schemas.opengeodeweb_back.save_viewable_file, + params, + }) await dataBaseStore.registerObject(id) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) From 0778788c1f65826c2987afb15236baaea5db0722 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 6 Oct 2025 17:10:07 +0200 Subject: [PATCH 29/38] logging problems --- .gitignore | 1 + .../microservices/viewer/requirements.txt | 2 +- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 17 +++++++++++++---- utils/local.js | 15 +++++++-------- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index dcb79d4b..4dce1a07 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ venv .pytest_cache __snapshots__ coverage +*.db # package-lock.json \ No newline at end of file diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index e58ef870..b84881e0 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -121,7 +121,7 @@ propcache~=0.3 # aiohttp # opengeodeweb-viewer # yarl -pyparsing~=3.2 +pyparsing~=3.3 # via # matplotlib # opengeodeweb-viewer diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index c60a46e9..139428cb 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -19,10 +19,12 @@ import { executable_path, kill_processes, run_viewer, + run_back } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" +// import { api_fetch } from "@ogw_f/utils/api_fetch" import * as composables from "@ogw_f/composables/viewer_call" import { useDataStyleStore } from "@ogw_f/stores/data_style" import { useDataBaseStore } from "@ogw_f/stores/data_base" @@ -30,6 +32,8 @@ import { useViewerStore } from "@ogw_f/stores/viewer" import { useInfraStore } from "@ogw_f/stores/infra" import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" +import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" +import appMode from "@ogw_f/utils/app_mode" import { WebSocket } from "ws" const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges @@ -68,29 +72,31 @@ beforeEach(async () => { const geodeStore = useDataBaseStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() - infraStore.app_mode = appMode.appMode.BROWSER + infraStore.app_mode = appMode.BROWSER const back_path = path.join( executable_path( path.join("tests", "integration", "microservices", "back"), ), - executable_name("opengeodeweb_back"), + executable_name("opengeodeweb-back"), ) const viewer_path = path.join( executable_path( path.join("tests", "integration", "microservices", "viewer"), ), - executable_name("opengeodeweb_viewer"), + executable_name("opengeodeweb-viewer"), ) const data_folder_path= path.join(__dirname, "..", "..", "..", "data") const back_port = await run_back(back_path, { port: 5000, data_folder_path, }) + console.log("Back path:", back_path); const viewer_port = await run_viewer(viewer_path, { port: 1234, data_folder_path }) + console.log("Viewer path:", viewer_path); geodeStore.default_local_port = back_port viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() @@ -100,7 +106,10 @@ beforeEach(async () => { filename:file_name, } await api_fetch({ schema: back_schemas.opengeodeweb_back.save_viewable_file, params }) - await dataBaseStore.registerObject(id) + console.log("api_fetch result:", params); + console.log("id from database:", id); + + await dataBaseStore.registerObject(id, file_name, geode_object) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) }, 15000) diff --git a/utils/local.js b/utils/local.js index 20022c06..01402a93 100644 --- a/utils/local.js +++ b/utils/local.js @@ -134,20 +134,18 @@ async function run_script( }) } -async function run_back(port, data_folder_path) { +async function run_back(command, args = { port, data_folder_path }) { return new Promise(async (resolve, reject) => { - const back_command = path.join( - executable_path(path.join("microservices", "back")), - executable_name("vease-back"), - ) - const back_port = await get_available_port(port) + const back_port = await get_available_port(args.port) + const upload_folder_path = path.join(args.data_folder_path, "uploads") const back_args = [ "--port " + back_port, - "--data_folder_path " + data_folder_path, + "--data_folder_path " + args.data_folder_path, + "--upload_folder_path " + upload_folder_path, "--allowed_origin http://localhost:*", "--timeout " + 0, ] - await run_script(back_command, back_args, "Serving Flask app") + await run_script(command, back_args, "Serving Flask app") resolve(back_port) }) } @@ -158,6 +156,7 @@ async function run_viewer(viewer_path, args = { port, data_folder_path }) { const viewer_args = [ "--port " + viewer_port, "--data_folder_path " + args.data_folder_path, + "--database_path " + args.data_folder_path, "--timeout " + 0, ] await run_script(viewer_path, viewer_args, "Starting factory") From 5981825d2259e9c2807d76d0912c4fdd1cb88a36 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:12:22 +0000 Subject: [PATCH 30/38] Apply prepare changes --- .../microservices/viewer/requirements.txt | 157 +----------------- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 21 +-- 2 files changed, 12 insertions(+), 166 deletions(-) diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index b84881e0..c8397d70 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -2,160 +2,5 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements-internal.in tests/integration/microservices/viewer/requirements.in +# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt --pre tests/integration/microservices/viewer/requirements.in # -aiohappyeyeballs~=2.6 - # via - # aiohttp - # opengeodeweb-viewer -aiohttp~=3.12 - # via - # opengeodeweb-viewer - # wslink -aiosignal~=1.4 - # via - # aiohttp - # opengeodeweb-viewer -attrs~=25.3 - # via - # aiohttp - # opengeodeweb-viewer -blinker~=1.9 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -click~=8.3 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -contourpy~=1.3 - # via - # matplotlib - # opengeodeweb-viewer -cycler~=0.12 - # via - # matplotlib - # opengeodeweb-viewer -fastjsonschema~=2.21 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer -flask~=3.1 - # via - # flask-sqlalchemy - # opengeodeweb-microservice - # opengeodeweb-viewer -flask-sqlalchemy~=3.1 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer -fonttools~=4.60 - # via - # matplotlib - # opengeodeweb-viewer -frozenlist~=1.7 - # via - # aiohttp - # aiosignal - # opengeodeweb-viewer -greenlet~=3.2 - # via - # opengeodeweb-microservice - # opengeodeweb-viewer - # sqlalchemy -idna==3.10 - # via - # opengeodeweb-viewer - # yarl -itsdangerous~=2.2 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -jinja2~=3.1 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -kiwisolver~=1.4 - # via - # matplotlib - # opengeodeweb-viewer -markupsafe~=3.0 - # via - # flask - # jinja2 - # opengeodeweb-microservice - # opengeodeweb-viewer - # werkzeug -matplotlib~=3.10 - # via - # opengeodeweb-viewer - # vtk -multidict~=6.6 - # via - # aiohttp - # opengeodeweb-viewer - # yarl -numpy~=2.3 - # via - # contourpy - # matplotlib - # opengeodeweb-viewer -opengeodeweb-microservice~=1.0 - # via opengeodeweb-viewer -opengeodeweb-viewer[cpu]~=1.11 - # via -r tests/integration/microservices/viewer/requirements-internal.in -packaging==25.0 - # via - # matplotlib - # opengeodeweb-viewer -pillow~=11.3 - # via - # matplotlib - # opengeodeweb-viewer -propcache~=0.3 - # via - # aiohttp - # opengeodeweb-viewer - # yarl -pyparsing~=3.3 - # via - # matplotlib - # opengeodeweb-viewer -python-dateutil==2.9.0.post0 - # via - # matplotlib - # opengeodeweb-viewer -six~=1.17 - # via - # opengeodeweb-viewer - # python-dateutil -sqlalchemy~=2.0 - # via - # flask-sqlalchemy - # opengeodeweb-microservice - # opengeodeweb-viewer -typing-extensions~=4.15 - # via - # aiosignal - # opengeodeweb-microservice - # opengeodeweb-viewer - # sqlalchemy -vtk~=9.5 - # via opengeodeweb-viewer -websocket-client~=1.8 - # via opengeodeweb-viewer -werkzeug~=3.1 - # via - # flask - # opengeodeweb-microservice - # opengeodeweb-viewer -wslink~=1.12 - # via opengeodeweb-viewer -yarl~=1.20 - # via - # aiohttp - # opengeodeweb-viewer diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 521e4d3f..943094b8 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -19,7 +19,7 @@ import { executable_path, kill_processes, run_viewer, - run_back + run_back, } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" @@ -75,9 +75,7 @@ beforeEach(async () => { infraStore.app_mode = appMode.BROWSER const back_path = path.join( - executable_path( - path.join("tests", "integration", "microservices", "back"), - ), + executable_path(path.join("tests", "integration", "microservices", "back")), executable_name("opengeodeweb-back"), ) const viewer_path = path.join( @@ -91,12 +89,12 @@ beforeEach(async () => { port: 5000, data_folder_path, }) - console.log("Back path:", back_path); + console.log("Back path:", back_path) const viewer_port = await run_viewer(viewer_path, { port: 1234, data_folder_path, }) - console.log("Viewer path:", viewer_path); + console.log("Viewer path:", viewer_path) geodeStore.default_local_port = back_port viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() @@ -105,10 +103,13 @@ beforeEach(async () => { input_geode_object: geode_object, filename: file_name, } - await api_fetch({ schema: back_schemas.opengeodeweb_back.save_viewable_file, params }) - console.log("api_fetch result:", params); - console.log("id from database:", id); - + await api_fetch({ + schema: back_schemas.opengeodeweb_back.save_viewable_file, + params, + }) + console.log("api_fetch result:", params) + console.log("id from database:", id) + await dataBaseStore.registerObject(id, file_name, geode_object) await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) From 24b339d336f53c12c5eb7e6ae0936e9aa899e80b Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Tue, 7 Oct 2025 17:24:49 +0200 Subject: [PATCH 31/38] Integration tests. work in progress. have to deal with generic_protocols --- composables/api_fetch.js | 2 +- .../data/{fake_id => uploads}/test.og_edc2d | Bin .../stores/DataStyle/mesh/Edges.nuxt.test.js | 118 ++++++++++-------- tests/unit/composables/api_fetch.nuxt.test.js | 114 ++++++++++------- utils/local.js | 3 +- 5 files changed, 132 insertions(+), 105 deletions(-) rename tests/integration/data/{fake_id => uploads}/test.og_edc2d (100%) diff --git a/composables/api_fetch.js b/composables/api_fetch.js index 4b6e501b..2f8cba2f 100644 --- a/composables/api_fetch.js +++ b/composables/api_fetch.js @@ -37,7 +37,7 @@ export function api_fetch( return useFetch(schema.$id, { baseURL: geode_store.base_url, ...request_options, - async onRequestError({ error }) { + async onRequestError(error) { await geode_store.stop_request() await feedback_store.add_error( error.code, diff --git a/tests/integration/data/fake_id/test.og_edc2d b/tests/integration/data/uploads/test.og_edc2d similarity index 100% rename from tests/integration/data/fake_id/test.og_edc2d rename to tests/integration/data/uploads/test.og_edc2d diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 521e4d3f..7f891f95 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -1,4 +1,5 @@ import path from "path" +// import fs from "fs" import { setActivePinia } from "pinia" import { createTestingPinia } from "@pinia/testing" @@ -19,17 +20,18 @@ import { executable_path, kill_processes, run_viewer, - run_back + run_back, } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status" -// import { api_fetch } from "@ogw_f/utils/api_fetch" +import { api_fetch } from "@ogw_f/composables/api_fetch" import * as composables from "@ogw_f/composables/viewer_call" import { useDataStyleStore } from "@ogw_f/stores/data_style" import { useDataBaseStore } from "@ogw_f/stores/data_base" import { useViewerStore } from "@ogw_f/stores/viewer" import { useInfraStore } from "@ogw_f/stores/infra" +import { useGeodeStore } from "@ogw_f/stores/geode" import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" @@ -57,7 +59,7 @@ afterAll(() => { delete global.WebSocket }) -const id = "fake_id" +let id = "fake_id" const file_name = "test.og_edc2d" const geode_object = "EdgedCurve2D" @@ -69,15 +71,18 @@ beforeEach(async () => { setActivePinia(pinia) const dataStyleStore = useDataStyleStore() const dataBaseStore = useDataBaseStore() - const geodeStore = useDataBaseStore() + const geodeStore = useGeodeStore() const viewerStore = useViewerStore() const infraStore = useInfraStore() infraStore.app_mode = appMode.BROWSER + // const data_folder_path = path.join(__dirname, "..", "..", "..", "data") + // if (!fs.existsSync(data_folder_path)) { + // fs.mkdirSync(data_folder_path, { recursive: true }) + // } + const back_path = path.join( - executable_path( - path.join("tests", "integration", "microservices", "back"), - ), + executable_path(path.join("tests", "integration", "microservices", "back")), executable_name("opengeodeweb-back"), ) const viewer_path = path.join( @@ -86,37 +91,42 @@ beforeEach(async () => { ), executable_name("opengeodeweb-viewer"), ) - const data_folder_path = path.join(__dirname, "..", "..", "..", "data") - const back_port = await run_back(back_path, { + + const { port: back_port } = await run_back(back_path, { port: 5000, data_folder_path, }) - console.log("Back path:", back_path); + + // await new Promise((resolve) => setTimeout(resolve, 5000)) + const viewer_port = await run_viewer(viewer_path, { port: 1234, data_folder_path, }) - console.log("Viewer path:", viewer_path); + console.log("back_port", back_port) geodeStore.default_local_port = back_port viewerStore.default_local_port = viewer_port await viewerStore.ws_connect() + console.log("schema", back_schemas.opengeodeweb_back.save_viewable_file) + + const response = await api_fetch({ + schema: back_schemas.opengeodeweb_back.save_viewable_file, + params: { + input_geode_object: geode_object, + filename: file_name, + }, + }) + id = response.data.value.id + + await dataBaseStore.registerObject(id) + await dataStyleStore.addDataStyle(id, geode_object, "mesh") - const params = { - input_geode_object: geode_object, - filename: file_name, - } - await api_fetch({ schema: back_schemas.opengeodeweb_back.save_viewable_file, params }) - console.log("api_fetch result:", params); - console.log("id from database:", id); - - await dataBaseStore.registerObject(id, file_name, geode_object) - await dataStyleStore.addDataStyle(id, geode_object, object_type) expect(viewerStore.status).toBe(Status.CONNECTED) }, 15000) describe("Mesh edges", () => { afterEach(async () => { - await kill_processes() + // await kill_processes() }) describe("Edges visibility", () => { @@ -129,36 +139,36 @@ describe("Mesh edges", () => { }) }) - describe("Edges active coloring", () => { - test("test coloring", async () => { - const dataStyleStore = useDataStyleStore() - const viewerStore = useViewerStore() - const coloringTypes = ["color"] - for (let i = 0; i < coloringTypes.length; i++) { - dataStyleStore.setEdgesActiveColoring(id, coloringTypes[i]) - expect(dataStyleStore.edgesActiveColoring(id)).toBe(coloringTypes[i]) - expect(viewerStore.status).toBe(Status.CONNECTED) - } - }) - }) - describe("Edges color", () => { - test("test red", async () => { - const dataStyleStore = useDataStyleStore() - const viewerStore = useViewerStore() - const color = { r: 255, g: 0, b: 0 } - const spy = vi.spyOn(composables, "viewer_call") - await dataStyleStore.setEdgesColor(id, color) - expect(spy).toHaveBeenCalledWith( - { - schema: mesh_edges_schemas.color, - params: { id, color }, - }, - { - response_function: expect.any(Function), - }, - ) - expect(dataStyleStore.edgesColor(id)).toStrictEqual(color) - expect(viewerStore.status).toBe(Status.CONNECTED) - }) - }) + // describe("Edges active coloring", () => { + // test("test coloring", async () => { + // const dataStyleStore = useDataStyleStore() + // const viewerStore = useViewerStore() + // const coloringTypes = ["color"] + // for (let i = 0; i < coloringTypes.length; i++) { + // dataStyleStore.setEdgesActiveColoring(id, coloringTypes[i]) + // expect(dataStyleStore.edgesActiveColoring(id)).toBe(coloringTypes[i]) + // expect(viewerStore.status).toBe(Status.CONNECTED) + // } + // }) + // }) + // describe("Edges color", () => { + // test("test red", async () => { + // const dataStyleStore = useDataStyleStore() + // const viewerStore = useViewerStore() + // const color = { r: 255, g: 0, b: 0 } + // const spy = vi.spyOn(composables, "viewer_call") + // await dataStyleStore.setEdgesColor(id, color) + // expect(spy).toHaveBeenCalledWith( + // { + // schema: mesh_edges_schemas.color, + // params: { id, color }, + // }, + // { + // response_function: expect.any(Function), + // }, + // ) + // expect(dataStyleStore.edgesColor(id)).toStrictEqual(color) + // expect(viewerStore.status).toBe(Status.CONNECTED) + // }) + // }) }) diff --git a/tests/unit/composables/api_fetch.nuxt.test.js b/tests/unit/composables/api_fetch.nuxt.test.js index 8280928a..2f7e446f 100644 --- a/tests/unit/composables/api_fetch.nuxt.test.js +++ b/tests/unit/composables/api_fetch.nuxt.test.js @@ -2,6 +2,8 @@ import { describe, expect, test, beforeEach, vi } from "vitest" import { setActivePinia } from "pinia" import { createTestingPinia } from "@pinia/testing" import { registerEndpoint } from "@nuxt/test-utils/runtime" +import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" +import { useGeodeStore } from "@ogw_f/stores/geode" describe("api_fetch", () => { const pinia = createTestingPinia({ @@ -51,58 +53,74 @@ describe("api_fetch", () => { required: ["test"], additionalProperties: false, } - const params = { test: "hello" } - expect(() => api_fetch({ schema, params })).toThrowError( - "data/test must be number", - ) - }) - - test("invalid params", async () => { - const schema = { - $id: "/test", - type: "object", - methods: ["POST"], - properties: { - test: { - type: "string", + // const params = { test: "hello" } + const file_name = "test.og_edc2d" + const geode_object = "EdgedCurve2D" + const params = { input_geode_object: geode_object, filename: file_name } + expect(() => + api_fetch( + { + schema: back_schemas.opengeodeweb_back.save_viewable_file, + params, }, - }, - required: ["test"], - additionalProperties: false, - } - const params = {} - expect(() => api_fetch({ schema, params })).toThrowError( - "data must have required property 'test'", - ) - }) - test("request error handling", async () => { - const schema = { - $id: "/test", - type: "object", - methods: ["POST"], - properties: { - test: { - type: "string", + { + response_function: (response) => + console.log("response_function", response), + response_error_function: (response) => + console.log("response_error_function", response), + request_error_function: (response) => + console.log("request_error_function", response), }, - }, - required: ["test"], - additionalProperties: false, - } - const params = { test: "hello" } - async function request_error_function() { - console.log("request_error_function") - } - const spy = vi.fn(request_error_function) - registerEndpoint(schema.$id, { - method: schema.methods[0], - handler: () => ({ return: "toto" }), - }) - await api_fetch({ schema, params }, { request_error_function }) - // expect(feedback_store.feedbacks.length).toBe(1) - await request_error_function() - // expect(spy).toHaveBeenCalledTimes(1) + ), + ).toThrowError("data/test must be number") }) + // test("invalid params", async () => { + // const schema = { + // $id: "/test", + // type: "object", + // methods: ["POST"], + // properties: { + // test: { + // type: "string", + // }, + // }, + // required: ["test"], + // additionalProperties: false, + // } + // const params = {} + // expect(() => api_fetch({ schema, params })).toThrowError( + // "data must have required property 'test'", + // ) + // }) + // test("request error handling", async () => { + // const schema = { + // $id: "/test", + // type: "object", + // methods: ["POST"], + // properties: { + // test: { + // type: "string", + // }, + // }, + // required: ["test"], + // additionalProperties: false, + // } + // const params = { test: "hello" } + // async function request_error_function() { + // console.log("request_error_function") + // } + // const spy = vi.fn(request_error_function) + // registerEndpoint(schema.$id, { + // method: schema.methods[0], + // handler: () => ({ return: "toto" }), + // }) + // await api_fetch({ schema, params }, { request_error_function }) + // // expect(feedback_store.feedbacks.length).toBe(1) + // await request_error_function() + // // expect(spy).toHaveBeenCalledTimes(1) + // }) + // test("response handling", async () => { // const schema = { // $id: "/test", diff --git a/utils/local.js b/utils/local.js index 01402a93..7012ddc2 100644 --- a/utils/local.js +++ b/utils/local.js @@ -146,7 +146,7 @@ async function run_back(command, args = { port, data_folder_path }) { "--timeout " + 0, ] await run_script(command, back_args, "Serving Flask app") - resolve(back_port) + resolve({ port: back_port }) }) } @@ -156,7 +156,6 @@ async function run_viewer(viewer_path, args = { port, data_folder_path }) { const viewer_args = [ "--port " + viewer_port, "--data_folder_path " + args.data_folder_path, - "--database_path " + args.data_folder_path, "--timeout " + 0, ] await run_script(viewer_path, viewer_args, "Starting factory") From 5537410397824b63b4a652a094cf3bc8d937b213 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 8 Oct 2025 01:00:20 +0200 Subject: [PATCH 32/38] addded viewer_object --- stores/data_base.js | 4 ++-- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stores/data_base.js b/stores/data_base.js index 452fa434..ef5d8924 100644 --- a/stores/data_base.js +++ b/stores/data_base.js @@ -42,10 +42,10 @@ export const useDataBaseStore = defineStore("dataBase", () => { } /** Actions **/ - async function registerObject(id) { + async function registerObject(id, viewer_object) { return viewer_call({ schema: viewer_schemas.opengeodeweb_viewer.generic.register, - params: { id }, + params: { id, viewer_object }, }) } async function addItem( diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 47e61875..e7e0f3bf 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -1,5 +1,5 @@ import path from "path" -// import fs from "fs" +import fs from "fs" import { setActivePinia } from "pinia" import { createTestingPinia } from "@pinia/testing" @@ -76,10 +76,10 @@ beforeEach(async () => { const infraStore = useInfraStore() infraStore.app_mode = appMode.BROWSER - // const data_folder_path = path.join(__dirname, "..", "..", "..", "data") - // if (!fs.existsSync(data_folder_path)) { - // fs.mkdirSync(data_folder_path, { recursive: true }) - // } + const data_folder_path = path.join(__dirname, "..", "..", "..", "data") + if (!fs.existsSync(data_folder_path)) { + fs.mkdirSync(data_folder_path, { recursive: true }) + } const back_path = path.join( executable_path(path.join("tests", "integration", "microservices", "back")), @@ -118,7 +118,7 @@ beforeEach(async () => { }) id = response.data.value.id - await dataBaseStore.registerObject(id) + await dataBaseStore.registerObject(id, "mesh") await dataStyleStore.addDataStyle(id, geode_object, "mesh") expect(viewerStore.status).toBe(Status.CONNECTED) From 53ce0c4ada81ae4f2173283a6ea1c0c68da39f29 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 8 Oct 2025 13:50:15 +0200 Subject: [PATCH 33/38] revert changes to api_fetch and api_fetch.nuxt.test.js and uncomment tests for Edges.nuxt.test.js --- composables/api_fetch.js | 2 +- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 64 +++++----- tests/unit/composables/api_fetch.nuxt.test.js | 114 ++++++++---------- 3 files changed, 81 insertions(+), 99 deletions(-) diff --git a/composables/api_fetch.js b/composables/api_fetch.js index 2f8cba2f..4b6e501b 100644 --- a/composables/api_fetch.js +++ b/composables/api_fetch.js @@ -37,7 +37,7 @@ export function api_fetch( return useFetch(schema.$id, { baseURL: geode_store.base_url, ...request_options, - async onRequestError(error) { + async onRequestError({ error }) { await geode_store.stop_request() await feedback_store.add_error( error.code, diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index e7e0f3bf..438bda58 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -139,36 +139,36 @@ describe("Mesh edges", () => { }) }) - // describe("Edges active coloring", () => { - // test("test coloring", async () => { - // const dataStyleStore = useDataStyleStore() - // const viewerStore = useViewerStore() - // const coloringTypes = ["color"] - // for (let i = 0; i < coloringTypes.length; i++) { - // dataStyleStore.setEdgesActiveColoring(id, coloringTypes[i]) - // expect(dataStyleStore.edgesActiveColoring(id)).toBe(coloringTypes[i]) - // expect(viewerStore.status).toBe(Status.CONNECTED) - // } - // }) - // }) - // describe("Edges color", () => { - // test("test red", async () => { - // const dataStyleStore = useDataStyleStore() - // const viewerStore = useViewerStore() - // const color = { r: 255, g: 0, b: 0 } - // const spy = vi.spyOn(composables, "viewer_call") - // await dataStyleStore.setEdgesColor(id, color) - // expect(spy).toHaveBeenCalledWith( - // { - // schema: mesh_edges_schemas.color, - // params: { id, color }, - // }, - // { - // response_function: expect.any(Function), - // }, - // ) - // expect(dataStyleStore.edgesColor(id)).toStrictEqual(color) - // expect(viewerStore.status).toBe(Status.CONNECTED) - // }) - // }) + describe("Edges active coloring", () => { + test("test coloring", async () => { + const dataStyleStore = useDataStyleStore() + const viewerStore = useViewerStore() + const coloringTypes = ["color"] + for (let i = 0; i < coloringTypes.length; i++) { + dataStyleStore.setEdgesActiveColoring(id, coloringTypes[i]) + expect(dataStyleStore.edgesActiveColoring(id)).toBe(coloringTypes[i]) + expect(viewerStore.status).toBe(Status.CONNECTED) + } + }) + }) + describe("Edges color", () => { + test("test red", async () => { + const dataStyleStore = useDataStyleStore() + const viewerStore = useViewerStore() + const color = { r: 255, g: 0, b: 0 } + const spy = vi.spyOn(composables, "viewer_call") + await dataStyleStore.setEdgesColor(id, color) + expect(spy).toHaveBeenCalledWith( + { + schema: mesh_edges_schemas.color, + params: { id, color }, + }, + { + response_function: expect.any(Function), + }, + ) + expect(dataStyleStore.edgesColor(id)).toStrictEqual(color) + expect(viewerStore.status).toBe(Status.CONNECTED) + }) + }) }) diff --git a/tests/unit/composables/api_fetch.nuxt.test.js b/tests/unit/composables/api_fetch.nuxt.test.js index 2f7e446f..8280928a 100644 --- a/tests/unit/composables/api_fetch.nuxt.test.js +++ b/tests/unit/composables/api_fetch.nuxt.test.js @@ -2,8 +2,6 @@ import { describe, expect, test, beforeEach, vi } from "vitest" import { setActivePinia } from "pinia" import { createTestingPinia } from "@pinia/testing" import { registerEndpoint } from "@nuxt/test-utils/runtime" -import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" -import { useGeodeStore } from "@ogw_f/stores/geode" describe("api_fetch", () => { const pinia = createTestingPinia({ @@ -53,74 +51,58 @@ describe("api_fetch", () => { required: ["test"], additionalProperties: false, } - // const params = { test: "hello" } - const file_name = "test.og_edc2d" - const geode_object = "EdgedCurve2D" - const params = { input_geode_object: geode_object, filename: file_name } - expect(() => - api_fetch( - { - schema: back_schemas.opengeodeweb_back.save_viewable_file, - params, + const params = { test: "hello" } + expect(() => api_fetch({ schema, params })).toThrowError( + "data/test must be number", + ) + }) + + test("invalid params", async () => { + const schema = { + $id: "/test", + type: "object", + methods: ["POST"], + properties: { + test: { + type: "string", }, - { - response_function: (response) => - console.log("response_function", response), - response_error_function: (response) => - console.log("response_error_function", response), - request_error_function: (response) => - console.log("request_error_function", response), + }, + required: ["test"], + additionalProperties: false, + } + const params = {} + expect(() => api_fetch({ schema, params })).toThrowError( + "data must have required property 'test'", + ) + }) + test("request error handling", async () => { + const schema = { + $id: "/test", + type: "object", + methods: ["POST"], + properties: { + test: { + type: "string", }, - ), - ).toThrowError("data/test must be number") + }, + required: ["test"], + additionalProperties: false, + } + const params = { test: "hello" } + async function request_error_function() { + console.log("request_error_function") + } + const spy = vi.fn(request_error_function) + registerEndpoint(schema.$id, { + method: schema.methods[0], + handler: () => ({ return: "toto" }), + }) + await api_fetch({ schema, params }, { request_error_function }) + // expect(feedback_store.feedbacks.length).toBe(1) + await request_error_function() + // expect(spy).toHaveBeenCalledTimes(1) }) - // test("invalid params", async () => { - // const schema = { - // $id: "/test", - // type: "object", - // methods: ["POST"], - // properties: { - // test: { - // type: "string", - // }, - // }, - // required: ["test"], - // additionalProperties: false, - // } - // const params = {} - // expect(() => api_fetch({ schema, params })).toThrowError( - // "data must have required property 'test'", - // ) - // }) - // test("request error handling", async () => { - // const schema = { - // $id: "/test", - // type: "object", - // methods: ["POST"], - // properties: { - // test: { - // type: "string", - // }, - // }, - // required: ["test"], - // additionalProperties: false, - // } - // const params = { test: "hello" } - // async function request_error_function() { - // console.log("request_error_function") - // } - // const spy = vi.fn(request_error_function) - // registerEndpoint(schema.$id, { - // method: schema.methods[0], - // handler: () => ({ return: "toto" }), - // }) - // await api_fetch({ schema, params }, { request_error_function }) - // // expect(feedback_store.feedbacks.length).toBe(1) - // await request_error_function() - // // expect(spy).toHaveBeenCalledTimes(1) - // }) - // test("response handling", async () => { // const schema = { // $id: "/test", From 18938dbc2b10fe96dc5b80adbb1ff61ba3cd80ad Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 8 Oct 2025 15:12:14 +0200 Subject: [PATCH 34/38] first version of folders removed after all integration tests --- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 438bda58..fe25ffdc 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -51,12 +51,45 @@ vi.stubGlobal("navigator", { }, }) +let foldersBeforeTests = new Set() +const data_folder_path = path.join(__dirname, "..", "..", "..", "data") + +function getCurrentFolders(dataFolderPath) { + if (!fs.existsSync(dataFolderPath)) { + return new Set() + } + const entries = fs.readdirSync(dataFolderPath) + const folders = new Set() + for (const entry of entries) { + const entryPath = path.join(dataFolderPath, entry) + if (fs.statSync(entryPath).isDirectory()) { + folders.add(entry) + } + } + return folders +} + +function cleanupCreatedFolders(dataFolderPath, foldersBeforeTests) { + if (!fs.existsSync(dataFolderPath)) { + return + } + const currentFolders = getCurrentFolders(dataFolderPath) + for (const folder of currentFolders) { + if (!foldersBeforeTests.has(folder)) { + const folderPath = path.join(dataFolderPath, folder) + fs.rmSync(folderPath, { recursive: true, force: true }) + } + } +} + beforeAll(() => { global.WebSocket = WebSocket + foldersBeforeTests = getCurrentFolders(data_folder_path) }) afterAll(() => { delete global.WebSocket + cleanupCreatedFolders(data_folder_path, foldersBeforeTests) }) let id = "fake_id" @@ -76,7 +109,6 @@ beforeEach(async () => { const infraStore = useInfraStore() infraStore.app_mode = appMode.BROWSER - const data_folder_path = path.join(__dirname, "..", "..", "..", "data") if (!fs.existsSync(data_folder_path)) { fs.mkdirSync(data_folder_path, { recursive: true }) } @@ -97,8 +129,6 @@ beforeEach(async () => { data_folder_path, }) - // await new Promise((resolve) => setTimeout(resolve, 5000)) - const viewer_port = await run_viewer(viewer_path, { port: 1234, data_folder_path, @@ -126,7 +156,7 @@ beforeEach(async () => { describe("Mesh edges", () => { afterEach(async () => { - // await kill_processes() + await kill_processes() }) describe("Edges visibility", () => { From 4687af3ecf9a3543b22f4d5bf829eac4ed173d2f Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Tue, 14 Oct 2025 07:26:45 +0000 Subject: [PATCH 35/38] Apply prepare changes --- tests/integration/microservices/back/requirements.txt | 3 ++- tests/integration/microservices/viewer/requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/microservices/back/requirements.txt b/tests/integration/microservices/back/requirements.txt index 68675c6c..bd3a3ef5 100644 --- a/tests/integration/microservices/back/requirements.txt +++ b/tests/integration/microservices/back/requirements.txt @@ -2,5 +2,6 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --output-file=tests/integration/microservices/back/requirements.txt --pre tests/integration/microservices/back/requirements.in +# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in # + diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index c8397d70..4d097394 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -2,5 +2,6 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt --pre tests/integration/microservices/viewer/requirements.in +# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in # + From 109ad42c830109fe5c5463a5ca4c375e0a3fe502 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Tue, 14 Oct 2025 11:36:51 +0200 Subject: [PATCH 36/38] fixed back_port --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 673e5545..43ab34cd 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -18,7 +18,6 @@ import { import { executable_name, executable_path, - kill_viewer, run_viewer, run_back, } from "@ogw_f/utils/local" @@ -124,7 +123,7 @@ beforeEach(async () => { executable_name("opengeodeweb-viewer"), ) - const { port: back_port } = await run_back(back_path, { + const back_port = await run_back(back_path, { port: 5000, data_folder_path, }) From 9132baefd40ba39b10823a6c60db36822869c3ee Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Tue, 14 Oct 2025 15:12:10 +0200 Subject: [PATCH 37/38] kill_back afterEach --- .../stores/DataStyle/mesh/Edges.nuxt.test.js | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 43ab34cd..7999dffa 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -123,15 +123,20 @@ beforeEach(async () => { executable_name("opengeodeweb-viewer"), ) - const back_port = await run_back(back_path, { + const back_promise = run_back(back_path, { port: 5000, data_folder_path, }) - const viewer_port = await run_viewer(viewer_path, { + const viewer_promise = run_viewer(viewer_path, { port: 1234, data_folder_path, }) + + const [back_port, viewer_port] = await Promise.all([ + back_promise, + viewer_promise, + ]) console.log("Viewer path:", viewer_path) geodeStore.default_local_port = back_port viewerStore.default_local_port = viewer_port @@ -153,12 +158,16 @@ beforeEach(async () => { expect(viewerStore.status).toBe(Status.CONNECTED) }, 15000) -describe("Mesh edges", () => { - afterEach(async () => { - const viewerStore = useViewerStore() - await kill_viewer(viewerStore.default_local_port) - }) +afterEach(async () => { + const viewerStore = useViewerStore() + const geodeStore = useGeodeStore() + await Promise.all([ + kill_viewer(viewerStore.default_local_port), + kill_back(geodeStore.default_local_port), + ]) +}) +describe("Mesh edges", () => { describe("Edges visibility", () => { test("test visibility true", async () => { const dataStyleStore = useDataStyleStore() From dbbc49f8c5799ceeec1a5a2ca8b08142d333ea9b Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Tue, 14 Oct 2025 15:38:14 +0200 Subject: [PATCH 38/38] missed imports --- tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js index 7999dffa..ca4b8ff6 100644 --- a/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +++ b/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js @@ -20,6 +20,8 @@ import { executable_path, run_viewer, run_back, + kill_viewer, + kill_back, } from "@ogw_f/utils/local" import Status from "@ogw_f/utils/status"