From 501c9f18785ecec45d6fd164dd847a587bbab811 Mon Sep 17 00:00:00 2001 From: BlockLucas Date: Wed, 11 Oct 2023 01:15:46 -0300 Subject: [PATCH 1/6] test snapshot with 500 branchlimit --- Jenkinsfile | 17 +++-------------- .../diagnostic/DiagnosticConverters.scala | 2 +- dependencies.properties | 2 +- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0bffc6cf8..59fa03168 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -81,20 +81,6 @@ pipeline { } } } - stage('Test') { - steps { - wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) { - script { - try { - sh 'sbt -mem 12000 -Dflaky.ignore=true -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 -Djava.io.tmpdir=$HOME clean coverage test coverageAggregate --warn' - } catch (e) { - failedStage = failedStage + " TEST " - unstable "Failed tests" - } - } - } - } - } stage('Coverage') { when { anyOf { @@ -148,6 +134,7 @@ pipeline { branch 'master' branch 'develop' branch 'rc/*' + branch 'w-14218793-sof' } } steps { @@ -169,6 +156,7 @@ pipeline { branch 'master' branch 'develop' branch 'rc/*' + branch 'w-14218793-sof' } } steps { @@ -198,6 +186,7 @@ pipeline { branch 'master' branch 'develop' branch 'rc/*' + branch 'w-14218793-sof' } } steps { diff --git a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala index 333f3b780..29f481821 100644 --- a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala +++ b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala @@ -135,7 +135,7 @@ object DiagnosticConverters { ): Seq[Seq[DiagnosticRelatedInformation]] = { val informationBranches: ListBuffer[ListBuffer[DiagnosticRelatedInformation]] = mutable.ListBuffer() val mainBranch: ListBuffer[DiagnosticRelatedInformation] = mutable.ListBuffer() - val branchLimit = 1000 + val branchLimit = 500 informationBranches.append(mainBranch) relatedFor(uri, reversedReferences, informationBranches, mainBranch, branchLimit, originFlag) informationBranches.size diff --git a/dependencies.properties b/dependencies.properties index 7d457ad8d..c6aa74530 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1,4 +1,4 @@ -version=6.1.0-SNAPSHOT +version=w-14218793-sof-500-SNAPSHOT amf=5.4.3-0 amf.custom-validator.js=1.4.0 amf.custom-validator-scalajs=0.5.3 From 2a9ada9083c783ed207496f65f1ad08cfa140437 Mon Sep 17 00:00:00 2001 From: BlockLucas Date: Wed, 11 Oct 2023 12:47:01 -0300 Subject: [PATCH 2/6] avoid adding existent branch, rollback to 1000 branch limit --- .../diagnostic/DiagnosticConverters.scala | 16 ++++++++++------ dependencies.properties | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala index 29f481821..e3a9e55d4 100644 --- a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala +++ b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala @@ -67,11 +67,15 @@ object DiagnosticConverters { } head match { case (DocumentLink(range, _, _), origin) => - if (originFlag) - branch.prepend(newDiagnostic(uri, range, origin)) - else - branch.append(newDiagnostic(uri, range, origin)) - relatedFor(origin, references, informationBranches, branch, branchLimit, originFlag) + val newD = newDiagnostic(uri, range, origin) + // avoid SOF by checking if we already added it, not using set as order is needed + if (!branch.contains(newD)) { + if (originFlag) + branch.prepend(newDiagnostic(uri, range, origin)) + else + branch.append(newDiagnostic(uri, range, origin)) + relatedFor(origin, references, informationBranches, branch, branchLimit, originFlag) + } } case _ => // over } @@ -135,7 +139,7 @@ object DiagnosticConverters { ): Seq[Seq[DiagnosticRelatedInformation]] = { val informationBranches: ListBuffer[ListBuffer[DiagnosticRelatedInformation]] = mutable.ListBuffer() val mainBranch: ListBuffer[DiagnosticRelatedInformation] = mutable.ListBuffer() - val branchLimit = 500 + val branchLimit = 1000 informationBranches.append(mainBranch) relatedFor(uri, reversedReferences, informationBranches, mainBranch, branchLimit, originFlag) informationBranches.size diff --git a/dependencies.properties b/dependencies.properties index c6aa74530..0af7666a9 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1,4 +1,4 @@ -version=w-14218793-sof-500-SNAPSHOT +version=w-14218793-sof-1000-branch-SNAPSHOT amf=5.4.3-0 amf.custom-validator.js=1.4.0 amf.custom-validator-scalajs=0.5.3 From 60b9728003d6d3da51a4f2b88a39c6dec261065d Mon Sep 17 00:00:00 2001 From: BlockLucas Date: Wed, 11 Oct 2023 14:51:48 -0300 Subject: [PATCH 3/6] lower branch limit to 100 --- .../als/server/modules/diagnostic/DiagnosticConverters.scala | 2 +- dependencies.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala index e3a9e55d4..f9525c4e0 100644 --- a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala +++ b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala @@ -139,7 +139,7 @@ object DiagnosticConverters { ): Seq[Seq[DiagnosticRelatedInformation]] = { val informationBranches: ListBuffer[ListBuffer[DiagnosticRelatedInformation]] = mutable.ListBuffer() val mainBranch: ListBuffer[DiagnosticRelatedInformation] = mutable.ListBuffer() - val branchLimit = 1000 + val branchLimit = 100 // reduced to avoid sof informationBranches.append(mainBranch) relatedFor(uri, reversedReferences, informationBranches, mainBranch, branchLimit, originFlag) informationBranches.size diff --git a/dependencies.properties b/dependencies.properties index 0af7666a9..06f4154d5 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1,4 +1,4 @@ -version=w-14218793-sof-1000-branch-SNAPSHOT +version=w-14218793-sof-100-branch-SNAPSHOT amf=5.4.3-0 amf.custom-validator.js=1.4.0 amf.custom-validator-scalajs=0.5.3 From 6df9b4e2458705bea60969ad6fc29c2185687aa0 Mon Sep 17 00:00:00 2001 From: BlockLucas Date: Wed, 11 Oct 2023 23:23:21 -0300 Subject: [PATCH 4/6] add test --- .../resources/workspace/sof-test/api.yaml | 325 ++++++++++++++++++ .../resources/workspace/sof-test/common.yaml | 129 +++++++ .../sof-test/endpoint/a-endpoint.yaml | 95 +++++ .../workspace/sof-test/endpoint/a.yaml | 41 +++ .../sof-test/endpoint/as-endpoint.yaml | 44 +++ .../sof-test/endpoint/c-endpoint.yaml | 172 +++++++++ .../sof-test/endpoint/d-endpoint.yaml | 81 +++++ .../sof-test/endpoint/df-endpoint.yaml | 159 +++++++++ .../sof-test/endpoint/h-endpoint.yaml | 181 ++++++++++ .../workspace/sof-test/endpoint/lkj.yaml | 195 +++++++++++ .../sof-test/endpoint/mi-endpoint.yaml | 166 +++++++++ .../sof-test/endpoint/pendpoint.yaml | 162 +++++++++ .../sof-test/endpoint/t-endpoint.yaml.yaml | 75 ++++ .../workspace/sof-test/exchange.json | 1 + .../workspace/WorkspaceManagerTest.scala | 27 ++ 15 files changed, 1853 insertions(+) create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/api.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/common.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/a-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/a.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/as-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/c-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/d-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/df-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/h-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/lkj.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/mi-endpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/pendpoint.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/endpoint/t-endpoint.yaml.yaml create mode 100644 als-server/shared/src/test/resources/workspace/sof-test/exchange.json diff --git a/als-server/shared/src/test/resources/workspace/sof-test/api.yaml b/als-server/shared/src/test/resources/workspace/sof-test/api.yaml new file mode 100644 index 000000000..27d19ee93 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/api.yaml @@ -0,0 +1,325 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: api + description: sdf + +servers: + - url: https://{platform}-{env}-test.com:443/api/api-{env}/{version} + description: a + variables: + platform: + enum: [asdf, fets] + default: asdf + description: name. + env: + enum: [dev, qa, stg, prod] + default: dev + description: Environment name. + version: + enum: [v1] + default: v1 + description: API version. + +paths: + + /a: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: Get a + parameters: + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + - $ref: endpoint/a-endpoint.yaml#/components/parameters/qifd + - $ref: endpoint/a-endpoint.yaml#/components/parameters/qitd + - $ref: endpoint/a-endpoint.yaml#/components/parameters/qitp + - $ref: endpoint/a-endpoint.yaml#/components/parameters/qiis + responses: + "200": + $ref: endpoint/a-endpoint.yaml#/components/responses/a-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /b/c: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: Get ha + parameters: + - name: csdc + in: query + required: true + schema: + type: string + format: date + - name: sdcsa + in: query + required: true + schema: + type: string + format: date + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + responses: + "200": + $ref: endpoint/a.yaml#/components/responses/a-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /d/{idSF}/f: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + + patch: + description: s + requestBody: + required: true + content: + application/json: + schema: + $ref: 'endpoint/t-endpoint.yaml#/components/schemas/pfasd' + responses: + "200": + $ref: endpoint/t-endpoint.yaml#/components/responses/t-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /tbs: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: bsf + parameters: + - $ref: endpoint/lkj.yaml#/components/parameters/qitp + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + responses: + "200": + $ref: endpoint/lkj.yaml#/components/responses/tbs-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /h/{idSF}/tbs: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + get: + description: dfg + responses: + "200": + $ref: endpoint/lkj.yaml#/components/responses/tbs-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "404": + $ref: common.yaml#/components/responses/error-response-404 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /m/absences: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: sfb + parameters: + - name: csdc + in: query + required: true + schema: + type: string + format: date + - name: sdcsa + in: query + required: true + schema: + type: string + format: date + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + responses: + "200": + $ref: endpoint/a.yaml#/components/responses/a-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + + /c: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + get: + description: fsv + parameters: + - $ref: endpoint/c-endpoint.yaml#/components/parameters/query-item-uid + responses: + "200": + $ref: endpoint/c-endpoint.yaml#/components/responses/c-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + post: + description: nrnb + requestBody: + required: true + content: + application/json: + schema: + $ref: 'endpoint/c-endpoint.yaml#/components/schemas/pco' + responses: + '201': + $ref: endpoint/c-endpoint.yaml#/components/responses/c-response-201 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /m: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: dfvs + parameters: + - $ref: endpoint/df-endpoint.yaml#/components/parameters/qitp + - $ref: endpoint/df-endpoint.yaml#/components/parameters/qihi + - $ref: endpoint/df-endpoint.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + responses: + "200": + $ref: endpoint/df-endpoint.yaml#/components/responses/mr-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /d: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: vsdvt + parameters: + - $ref: endpoint/d-endpoint.yaml#/components/parameters/qitp + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + responses: + "200": + $ref: endpoint/d-endpoint.yaml#/components/responses/d-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /fasd: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + - $ref: common.yaml#/components/parameters/request-token + get: + description: s + parameters: + - $ref: endpoint/pendpoint.yaml#/components/parameters/qitp + - $ref: common.yaml#/components/parameters/qip + - $ref: common.yaml#/components/parameters/qis + responses: + "200": + $ref: endpoint/pendpoint.yaml#/components/responses/p-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /h/{idSF}/fasd: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + get: + description: nrbdf + responses: + "200": + $ref: endpoint/pendpoint.yaml#/components/responses/p-response-200 + "400": + $ref: common.yaml#/components/responses/error-response-400 + "404": + $ref: common.yaml#/components/responses/error-response-404 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /h: + parameters: + - $ref: "common.yaml#/components/parameters/header-client-id" + - $ref: "common.yaml#/components/parameters/header-client-secret" + + post: + tags: [h] + operationId: post-h + summary: aksjdbf + description: brtbw + requestBody: + $ref: "endpoint/h-endpoint.yaml#/components/requestBodies/rbh" + responses: + '201': + $ref: "endpoint/h-endpoint.yaml#/components/responses/hr-201" + "400": + $ref: common.yaml#/components/responses/error-response-400 + "401": + $ref: common.yaml#/components/responses/error-response-401 + "500": + $ref: common.yaml#/components/responses/error-response-500 + + /as: + parameters: + - $ref: common.yaml#/components/parameters/header-client-id + - $ref: common.yaml#/components/parameters/header-client-secret + get: + description: trdfv + responses: + "200": + $ref: endpoint/as-endpoint.yaml#/components/responses/ar-200 diff --git a/als-server/shared/src/test/resources/workspace/sof-test/common.yaml b/als-server/shared/src/test/resources/workspace/sof-test/common.yaml new file mode 100644 index 000000000..36d08ad0d --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/common.yaml @@ -0,0 +1,129 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: common + +paths: {} + +components: + + parameters: + + header-client-id: + in: header + name: x-client-id + schema: + type: string + example: "a710fc67c6ef470e8aa88d0cfa8fbf9a" + required: true + description: brwfv + + header-client-secret: + in: header + name: x-client-secret + schema: + type: string + example: "b510fc67fdef440e8aa78d0cfa8fbf2b" + required: true + description: bwrtevr + + request-token: + in: header + name: request-token + schema: + type: string + example: "0s84H143FCjzDdpQYF" + required: false + description: vevfv + + x-correlation-id: + in: header + name: x-correlation-id + required: true + description: z + schema: + type: string + format: uuid + nullable: false + minLength: 36 + maxLength: 36 + example: "93c4302b-1cde-413c-9088-c5ef7a8bd328" + + x-source-system: + in: header + name: x-source-system + required: false + description: vdfbt + schema: + type: string + nullable: false + minLength: 1 + maxLength: 50 + pattern: ^[\w-]+$ + example: "p-mm-xxxx" + + qifd: + in: query + name: csdc + schema: + type: string + format: date-time + example: 2012-02-02T00:00:00Z + required: true + + qitd: + in: query + name: sdcsa + schema: + type: string + format: date-time + example: 2012-02-02T00:00:00Z + required: true + + qihi: + in: query + name: hidi + schema: + type: string + example: "605005" + required: false + + qip: + in: query + name: page + schema: + type: integer + example: 2 + required: false + + qis: + in: query + name: size + schema: + type: integer + minimum: 200 + maximum: 2000 + required: false + + schemas: + property-typePanel: + description: sdfbt + + type: string + enum: [asdf, asd, gref] + example: asdf + + + responses: + + error-response-401: + description: Unauthorized or invalid + + error-response-400: + description: Bad request + + error-response-404: + description: Not found + + error-response-500: + description: Bad response from authorization server diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/a-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/a-endpoint.yaml new file mode 100644 index 000000000..6c8eddec5 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/a-endpoint.yaml @@ -0,0 +1,95 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: a-endpoint +paths: {} + +components: + parameters: + qitp: + in: query + name: typePanel + schema: + type: string + enum: [asdf, gwe, fwe] + example: asdf + required: true + qiis: + in: query + name: qiis + schema: + description: verv + type: string + enum: [fasd, cew, asdc] + example: fasd + required: false + + qifd: + in: query + name: csdc + schema: + description: afva + type: string + format: date-time + example: 2012-08-21T07:30:00Z + required: true + qitd: + in: query + name: sdcsa + schema: + description: Vasfg + type: string + format: date-time + example: 2012-08-22T07:30:00Z + required: true + + schemas: + aObject: + type: object + properties: + idSF: + description: a + type: string + example: "1014H00000KxOqqQAF" + id: + description: a + type: integer + example: 7046495 + typePanel: + description: b + type: string + enum: [FDS, FSDF, ASDF] + example: FDS + dtd: + description: C + type: string + format: date-time + example: 2024-02-02T09:10:00Z + df: + description: asdfv4v + type: string + format: date-time | nil + example: 2024-02-02T11:00:00Z + type: + description: Z + type: integer + example: 3 + asdcce: + description: D + type: string + enum: [SDFA, GDAFG, ASDFJBK] + example: ASDFJBK + responses: + a-response-200: + description: Success + headers: + request-token: + schema: + type: string + description: pagination token. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/aObject" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/a.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/a.yaml new file mode 100644 index 000000000..0feada0d3 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/a.yaml @@ -0,0 +1,41 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: p-endpoint +paths: {} + +components: + schemas: + aObject: + type: object + properties: + idSF: + type: string + example: "3142X00103Zh74IQAY" + dtd: + type: string + format: date + example: 2021-02-02 + df: + type: string + format: date | nil + type: + type: integer + example: 2 + horsFce: + type: boolean + example: true + responses: + a-response-200: + description: Success + headers: + request-token: + schema: + type: string + description: pagination token. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/aObject" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/as-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/as-endpoint.yaml new file mode 100644 index 000000000..cb0aa2922 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/as-endpoint.yaml @@ -0,0 +1,44 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: as-endpoint +paths: {} + +components: + schemas: + asso: + type: object + properties: + app-name: + type: string + example: Sample sd API + api-id: + type: string + example: "181149" + api-name: + type: string + example: sample-sdf-api + version: + type: string + example: v1 + environment: + type: string + example: dev + status: + type: string + enum: [pass,fail,warn] + example: fail + details: + type: string + example: Cannot create connection to back-end system XYZ + timestamp: + type: string + format: date-time + example: 2021-10-04T00:00:00Z + responses: + ar-200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/asso" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/c-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/c-endpoint.yaml new file mode 100644 index 000000000..c722cf01b --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/c-endpoint.yaml @@ -0,0 +1,172 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: c-endpoint +paths: {} + +components: + parameters: + query-item-uid: + in: query + name: uid + schema: + type: string + example: "2000123" + required: true + description: afvdafv + schemas: + cObject: + type: object + properties: + idcf: + description: asfvas + type: string + nullable: true + example: "a1Y3H000000Qm2WZAS" + idf: + description: asfga + type: integer + example: 2000123 + typePanel: + description: dfnv + type: string + enum: [sadf, ewc, AIwecweP] + example: sadf + signee: + description: afjnga + type: boolean + example: true + dateSignature: + description: gasfs + type: string + format: date + nullable: true + example: "2021-02-21" + dateRefus: + description: asdfsaf + type: string + format: date + nullable: true + example: "2022-01-18" + m: + description: sadvr + type: object + properties: + asdfcwecw: + description: asdf + type: string + example: "a1z3H00000084WbQAI" + nom: + description: berv + type: string + example: "fsadce" + type: + description: brtv + type: integer + enum: [1, 2, 3] + example: 2 + version: + description: skjnd + type: integer + example: 3 + paneliste: + type: object + nullable: true + properties: + iiSF: + description: jvknfd + type: string + example: "0044H00000UQ8cLQZT" + signataire: + description: jkansdc + type: object + properties: + sdfvdvcd: + description: asdf + type: string + example: "0044H00000UQ8cLQZT" + prenom: + description: nklfvd + type: string + example: "csd" + nom: + description: asdd + type: string + example: "ceww" + dateNaissance: + description: asdf + type: string + format: date + example: 1999-10-04 + personneDeRef: + description: gasd + type: boolean + example: false + + pco: + type: array + items: + type: object + properties: + idcf: + description: asdfg + type: string + pattern: ^\w+$ + nullable: true + example: "a1Y3H000000Qm2WZZZ" + idRefConventionSF: + description: bdfvr + type: string + pattern: ^\w+$ + nullable: false + example: "a1Y3H000000Qm2WZZZ" + idf: + description: asdfv + type: integer + example: 9100123 + dateSignature: + description: berv + type: string + format: date + pattern: ^\d{2,4}-\d{2}-\d{2}$ + nullable: true + example: "2022-02-21" + dateRefus: + description: kbsdjf + type: string + format: date + pattern: ^\d{2,4}-\d{2}-\d{2}$ + nullable: true + example: "2022-01-18" + paneliste: + type: object + nullable: true + properties: + iiSF: + description: jkasndf + type: string + pattern: ^\w+$ + example: "a1Y3H000000Qm2WZZZ" + signataire: + type: object + properties: + iidSF: + description: jkns + type: string + pattern: ^\w+$ + example: "a1Y3H000000Qm2WZZZ" + + responses: + c-response-200: + description: ger + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/cObject" + c-response-201: + description: + content: + application/json: + example: "Sample" diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/d-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/d-endpoint.yaml new file mode 100644 index 000000000..50f46ebaa --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/d-endpoint.yaml @@ -0,0 +1,81 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: d-endpoint +paths: {} + +components: + parameters: + qitp: + in: query + name: typePanel + schema: + type: string + enum: [MMT, PAME, AIP] + example: MMT + required: false + schemas: + dObject: + type: object + properties: + content: + type: array + items: + type: object + properties: + id: + type: string + example: "0254X00003QhAJvSGH" + idf: + type: string + example: "0198X00006StAJvNFE" + idPoste: + type: string + example: "32fdf26ffdf8596" + nom: + type: string + example: "d1" + type: + description: fsadf + type: integer + enum: [7,8,9,10] + example: 9 + emplacement: + type: integer + example: 1 + sdfvdvcd: + type: string + example: "0098X00006StAJvZZZ" + usagePrincipal: + type: boolean + example: true + gqercwq: + type: integer + example: 0 + totalPages: + type: integer + example: 0 + last: + type: boolean + example: true + size: + type: integer + example: 50 + page: + type: integer + example: 0 + + responses: + d-200: + description: Success + headers: + request-token: + schema: + type: string + description: pagination token. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/dObject" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/df-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/df-endpoint.yaml new file mode 100644 index 000000000..f4c8d9be2 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/df-endpoint.yaml @@ -0,0 +1,159 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: df-endpoint +paths: {} + +components: + parameters: + qihi: + in: query + name: hidi + schema: + type: string + example: "604105" + required: false + qitp: + in: query + name: typePanel + schema: + type: string + enum: [MMsdfT, fsadc, asdc] + example: MMsdfT + required: false + qif: + in: query + name: flow + schema: + type: string + example: "sdfc" + required: false + qip: + in: query + name: pilote + schema: + type: string + example: "SXA3" + required: false + + schemas: + vasdce: + type: object + properties: + content: + type: array + items: + type: object + properties: + vecwe: + description: as + type: string + example: "02i3H000004o3dvZZZ" + idf: + description: ver + type: string + example: "a155r010000oor5AAA" + idfc: + description: ver + type: integer + example: 7129515 + typePanel: + description: vre + + type: string + enum: [csdc, cdxc, csdcs] + example: csdc + nom: + description: vfas + type: string + example: "ZFV4 253BD619" + fsadc: + description: erv + type: string + example: "243BD620" + asdcsd: + type: integer + description: vafvcs + example: 81083262 + type: + description: fre + type: integer + example: 22 + vfvdce: + description: vafs + type: string + enum: [cds, sda, scsd, avsd] + example: cds + vasdcweg: + description: sasd + type: string + example: "a115r000001mf9TZZ" + vracedsc: + type: string + example: "cdsc2" + oivnlrk: + type: string + example: "1.0" + viorekl: + type: string + example: "123456" + ouvhr: + description: fsdc + + type: integer + example: 2 + asdcce: + type: integer + example: 2 + numPoste: + description: sbj + type: integer + example: 2 + postePrincipal: + description: bjkvsd + type: boolean + example: true + deconnecte: + description: ajsdn + type: boolean + example: true + suspendu: + description: sjnd + type: boolean + example: false + gqercwq: + type: integer + example: 0 + totalPages: + type: integer + example: 0 + last: + type: boolean + example: true + size: + type: integer + example: 50 + page: + type: integer + example: 0 + + + responses: + mr-202: + description: Success + content: + application/json: + example: "Your request accepted for update" + mr-200: + description: Success + headers: + request-token: + schema: + type: string + description: pagination token. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/vasdce" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/h-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/h-endpoint.yaml new file mode 100644 index 000000000..1ade590e3 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/h-endpoint.yaml @@ -0,0 +1,181 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: h-endpoint + +paths: {} + +components: + + requestBodies: + rbh: + required: true + content: + application/json; charset=utf-8: + schema: + $ref: "#/components/schemas/phh" + + schemas: + phh: + description: dafg + type: object + additionalProperties: false + properties: + idf: + description: kjbsd + type: string + minLength: 15 + maxLength: 18 + nullable: true + pattern: ^[0-9a-zA-Z]{15,18}$ + uuid: + description: ibsjkdf + type: string + format: uuid + nullable: false + minLength: 36 + maxLength: 36 + pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ + idfc: + description: kjbsd + type: integer + nullable: false + minimum: 1 + fsd: + description: dfg. + type: object + additionalProperties: false + properties: + sdcsd: + description: vasd + type: string + nullable: true + minLength: 1 + maxLength: 255 + vfvac: + description: asd + type: string + nullable: false + minLength: 1 + maxLength: 20 + csdc: + description: gasd + type: string + nullable: false + minLength: 1 + maxLength: 40 + sdsadf: + description: adfge + type: string + nullable: true + maxLength: 255 + fsdc: + description: tesv + + type: string + enum: [sdf, cdsc, fewf] + example: fewf + vagueEtude: + description: skjbd + type: string + nullable: true + minLength: 1 + maxLength: 50 + example: "vadfv" + pilote: + description: fbkjs + type: string + nullable: true + minLength: 1 + maxLength: 255 + example: "vsadvc" + equipements: + description: sbkj + type: object + nullable: true + additionalProperties: false + properties: + equipeTv: + description: kjbsdf + type: boolean + nullable: true + example: true + nbTv: + description: kbjf + type: integer + enum: [0, 1, 2, 3, 4, 5] + nullable: true + example: 1 + nbTvTotal: + description: bgksjd + type: integer + enum: [0, 1, 2, 3, 4, 5] + nullable: true + example: 1 + fsdc: + description: bskjdf + type: integer + nullable: true + example: 2 + bree: + description: jkbsd + type: integer + nullable: true + example: 2 + nbPc: + description: kjbg + type: integer + nullable: true + example: 2 + ascdew: + description: jsdnf + type: integer + enum: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + nullable: true + example: 1 + bteqfe: + description: ugkbg + type: integer + enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + nullable: true + example: 1 + afdnyte: + description: afg. + type: boolean + nullable: true + example: true + yrjrg: + description: asdf + type: integer + nullable: true + example: 1 + dgju: + description: Ngf + type: integer + nullable: true + example: 1 + csadfef: + type: array + minItems: 1 + maxItems: 100 + uniqueItems: true + items: + $ref: "mi-endpoint.yaml#/components/schemas/vfdcsd" + + responses: + hr-201: + description: Success + headers: + x-correlation-id: + required: true + description: kjhasdf + schema: + type: string + format: uuid + nullable: false + minLength: 36 + maxLength: 36 + content: + application/json: + schema: + $ref: "#/components/schemas/phh" diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/lkj.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/lkj.yaml new file mode 100644 index 000000000..d7c7b0abb --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/lkj.yaml @@ -0,0 +1,195 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: t-endpoint +paths: {} + +components: + parameters: + qitp: + in: query + name: typePanel + schema: + description: + type: string + enum: [csadc, cscadc, csdc] + example: cscadc + required: true + schemas: + tbsObject: + type: object + properties: + content: + type: array + items: + type: object + properties: + jksndo: + description: g + type: string + hbqweo: + description: sd + type: string + htve: + description: a + type: integer + enum: [1] + example: 1 + cxvpoipo: + type: integer + example: 1 + asdfkbwi: + type: string + example: "drofspt" + lhvkaklw: + description: f + type: integer + enum: [0,1,2,3,4,5,6] + example: 2 + ljnvenbmw: + description: jvjh + type: integer + enum: [1,2,3,4,5,6,7,8,9,10,11,12] + example: 8 + kjbs: + type: integer + example: 2022 + hvjhasoilw: + type: integer + example: 123 + m: + type: string + bnmsdiu: + type: boolean + example: true + asdvrt: + type: boolean + example: true + powie: + type: boolean + example: true + oixuv: + type: boolean + example: true + kbjdfkl: + type: boolean + example: true + hrwger: + type: boolean + example: true + bwrtv5e: + type: boolean + example: true + k6jtehre: + description: jhgk + type: integer + enum: [1,2,3,4] + example: 2 + k87ktrj: + type: integer + example: 10 + shdfv4: + type: boolean + example: true + seizeNeuvieme: + type: boolean + example: true + combineZZZZZ: + description: jhvbnlk + type: integer + enum: [0,1,2] + example: 1 + brwtcerc: + type: boolean + example: true + qweqergth: + type: boolean + example: true + fqwewex: + type: boolean + example: true + htyehjet: + type: boolean + example: true + qvercqw5g: + type: boolean + example: true + jtyjg5g: + type: integer + gqercwq: + type: integer + example: 0 + totalPages: + type: integer + example: 0 + last: + type: boolean + example: true + size: + type: integer + example: 50 + page: + type: integer + example: 0 + patchtbsObject: + type: array + items: + type: object + properties: + idfs: + type: string + example: "0013X00003QhBtZZZZ" + ucjknlwe: + type: string + example: "0013X00003QhBtZZZZ" + combineZZZZZ: + type: boolean + example: true + idZF: + type: integer + example: 3 + viubjkrewn: + type: boolean + example: true + jaslndkfckew: + type: boolean + example: true + clnwec: + type: boolean + example: false + vnlkre: + type: boolean + example: true + jkvdfn9: + type: boolean + example: false + dffwewe: + type: integer + example: 4 + idmmConsole: + type: integer + example: 2 + asgeecw: + type: boolean + example: true + hregfwed: + type: boolean + example: true + ksjbndclkw: + type: boolean + example: false + + responses: + tbs-response-200: + description: Success + headers: + request-token: + schema: + type: string + description: pagination token. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/tbsObject" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/mi-endpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/mi-endpoint.yaml new file mode 100644 index 000000000..699ca5c04 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/mi-endpoint.yaml @@ -0,0 +1,166 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: mi-endpoint +paths: {} + +components: + parameters: + path-id: + in: path + name: id + schema: + type: string + example: "ABC" + required: true + flow: + in: query + name: flow + schema: + type: string + example: "dfs-fsdf-sip" + required: false + uid: + description: dfge + in: query + name: uid + schema: + type: string + required: false + + schemas: + updatemObject: + type: object + uro: + type: object + properties: + description: + type: string + example: "Your request accepted for update" + + vdfklsnd: + description: gasdf + type: object + additionalProperties: false + required: + - type + - dateSignature + properties: + type: + description: gasdf + type: string + enum: + - asdc + - c + - csdc + example: "asdc" + dateSignature: + description: sibdn + type: string + format: date + nullable: false + minLength: 8 + maxLength: 10 + pattern: ^\d{2,4}-\d{2}-\d{2}$ + example: 2017-10-04 + + vfdcsd: + type: object + additionalProperties: false + required: + - uuid + - jnlwed + - voieryh + - cuiherio + - bterqc + properties: + sdfvdvcd: + description: sbjkfd + type: string + nullable: true + minLength: 15 + maxLength: 18 + pattern: ^\w+$ + uuid: + description: kbsjadf + type: string + format: uuid + nullable: false + minLength: 36 + maxLength: 36 + ii: + description : TOBECHECKED + type: integer + nullable: true + minimum: 1 + example: 123 + prenom: + description: uksjnd + type: string + nullable: true + minLength: 1 + maxLength: 80 + nom: + description: iushdf + type: string + nullable: true + minLength: 1 + maxLength: 80 + jnlwed: + description: saf + type: string + format: date + nullable: false + minLength: 8 + maxLength: 10 + pattern: ^\d{2,4}-\d{2}-\d{2}$ + example: 2017-10-04 + bterqc: + description: asdf + type: integer + enum: [1, 2] + nullable: false + example: 1 + voieryh: + description: vqer + type: boolean + nullable: false + default: false + example: false + cuiherio: + description: veq + type: boolean + nullable: false + default: true + example: true + jkvsankje: + description: veq + type: string + nullable: true + minLength: 1 + maxLength: 1 + pattern: ^[A-H]$ + example: A + sdfwecw: + description: vre + type: array + minItems: 0 + maxItems: 10 + nullable: true + uniqueItems: true + items: + $ref: "mi-endpoint.yaml#/components/schemas/vdfklsnd" + + responses: + m-response-201: + description: Successful put + content: + application/json: + schema: + $ref: "#/components/schemas/uro" + m-response-202: + description: Successful put + content: + application/json: + schema: + $ref: "#/components/schemas/uro" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/pendpoint.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/pendpoint.yaml new file mode 100644 index 000000000..fe6d53eeb --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/pendpoint.yaml @@ -0,0 +1,162 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: d-endpoint +paths: {} + +components: + parameters: + qitp: + in: query + name: typePanel + schema: + type: string + enum: [MMT, PAME, AIP] + example: MMT + required: false + schemas: + fasd: + description: ver + type: object + properties: + content: + type: array + items: + type: object + properties: + id: + description: kjbsd + type: string + idf: + description: kjsdnf + type: string + sadf: + description: djs + type: string + type: + description: vsad + type: integer + enum: [2,3,4,5,6] + example: 2 + verv: + type: string + example: "nom" + jaslndkfckew: + type: boolean + example: true + clnwec: + type: boolean + example: true + asdfcs: + type: boolean + example: true + vnlkre: + type: boolean + example: true + sdfw: + type: integer + example: 1 + berfw: + type: boolean + example: true + asgeecw: + type: boolean + example: true + dftjnr: + type: boolean + example: true + hregfwed: + type: boolean + example: true + dffwewe: + type: integer + example: 1 + fgbs: + type: string + format: date + example: 2022-02-02 + jrthfer: + type: boolean + example: true + oihlskndf: + type: boolean + example: true + xopcuv: + type: boolean + example: true + mqbwe: + type: boolean + example: true + acoivu: + type: boolean + example: true + ksjbndclkw: + type: boolean + example: true + akjsbdfo: + type: integer + example: 1 + sdoihv: + description: ifsd + type: string + kjsdfpo: + type: integer + example: 2 + jkbweoi: + type: boolean + example: true + ibjascnp: + type: integer + example: 1 + sdjnco: + type: boolean + example: true + thrwfwe: + type: boolean + example: true + asvrger: + type: integer + example: 1 + fgsjadf: + type: boolean + example: true + cqerfh: + type: integer + example: 1 + dfgwg: + type: array + items: + type: integer + example: [1, 2, 3] + + + gqercwq: + type: integer + example: 0 + totalPages: + type: integer + example: 0 + last: + type: boolean + example: true + size: + type: integer + example: 50 + page: + type: integer + example: 0 + + responses: + p-response-200: + description: Success + headers: + request-token: + schema: + type: string + description: pagination token. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/fasd" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/endpoint/t-endpoint.yaml.yaml b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/t-endpoint.yaml.yaml new file mode 100644 index 000000000..7be7f3753 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/endpoint/t-endpoint.yaml.yaml @@ -0,0 +1,75 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: lkj +paths: {} + +components: + schemas: + pfasd: + type: array + items: + type: object + properties: + idSF: + type: string + required: true + ucjknlwe: + type: string + required: true + combineZZZZZ: + type: integer + enum: [0, 1, 2] + example: 0 + nullable: true + idZF: + type: integer + example: 3 + nullable: true + viubjkrewn: + type: boolean + example: true + nullable: true + jaslndkfckew: + type: boolean + example: true + nullable: true + clnwec: + type: boolean + example: false + nullable: true + vnlkre: + type: boolean + example: true + nullable: true + lecteurDvdTnt: + type: boolean + example: false + nullable: true + dffwewe: + type: integer + example: 4 + nullable: true + idmConsole: + type: integer + example: 2 + nullable: true + asgeecw: + type: boolean + example: true + nullable: true + hregfwed: + type: boolean + example: true + nullable: true + ksjbndclkw: + type: boolean + example: false + nullable: true + + responses: + t-response-200: + description: Success + content: + application/json: + example: "Sample" \ No newline at end of file diff --git a/als-server/shared/src/test/resources/workspace/sof-test/exchange.json b/als-server/shared/src/test/resources/workspace/sof-test/exchange.json new file mode 100644 index 000000000..6154794a0 --- /dev/null +++ b/als-server/shared/src/test/resources/workspace/sof-test/exchange.json @@ -0,0 +1 @@ +{"main":"api.yaml","name":"api","classifier":"oas","tags":[],"groupId":"aef6659d-4b5c-5bed-8d59-654bb50e88f9","assetId":"api","version":"1.2.5","apiVersion":"1.0.0","originalFormatVersion":"3.0","organizationId":"aef6659d-4b5c-5bed-8d59-654bb50e88f9"} \ No newline at end of file diff --git a/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala b/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala index 2c4e0ab91..87396bba3 100644 --- a/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala +++ b/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala @@ -730,6 +730,33 @@ class WorkspaceManagerTest extends LanguageServerBaseTest { } } + // This test evades a SOF in AALS, here it throws timeout if it is not working + // SOF is fixed by making uniques the stored branches + // timeout is fixed by lowering the branch limit that affects the relatedInformation in relatedFor + // After fixing this 2 things, performance in APID is fixed + test("Workspace Manager OAS 3 SOF relatedFor branches case", Flaky) { + val diagnosticClientNotifier: MockDiagnosticClientNotifierWithTelemetryLog = + new MockDiagnosticClientNotifierWithTelemetryLog(60000) + withServer[Assertion](buildServer(diagnosticClientNotifier)) { server => + val rootFolder = s"${filePath("sof-test")}" + for { + _ <- server.testInitialize( + AlsInitializeParams( + None, + Some(TraceKind.Off), + rootUri = Some(rootFolder) + ) + ) + _ <- setMainFile(server)(rootFolder, "api.yaml") + a <- diagnosticClientNotifier.nextCall + } yield { + server.shutdown() + val allDiagnostics = Seq(a) + assert(allDiagnostics.size == allDiagnostics.map(_.uri).distinct.size) + } + } + } + test("Workspace Manager check validation Stack - Performance case - wait", Flaky) { val diagnosticClientNotifier: MockDiagnosticClientNotifierWithTelemetryLog = new MockDiagnosticClientNotifierWithTelemetryLog(60000) From ef4be70bdb017bd1428ebd220b7c4e497c8632a5 Mon Sep 17 00:00:00 2001 From: BlockLucas Date: Wed, 11 Oct 2023 23:29:01 -0300 Subject: [PATCH 5/6] prepare for merge --- Jenkinsfile | 17 ++++++++++++++--- .../diagnostic/DiagnosticConverters.scala | 2 +- .../server/workspace/WorkspaceManagerTest.scala | 7 ++----- dependencies.properties | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 59fa03168..0bffc6cf8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -81,6 +81,20 @@ pipeline { } } } + stage('Test') { + steps { + wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) { + script { + try { + sh 'sbt -mem 12000 -Dflaky.ignore=true -Dsbt.global.base=.sbt -Dsbt.boot.directory=.sbt -Dsbt.ivy.home=.ivy2 -Djava.io.tmpdir=$HOME clean coverage test coverageAggregate --warn' + } catch (e) { + failedStage = failedStage + " TEST " + unstable "Failed tests" + } + } + } + } + } stage('Coverage') { when { anyOf { @@ -134,7 +148,6 @@ pipeline { branch 'master' branch 'develop' branch 'rc/*' - branch 'w-14218793-sof' } } steps { @@ -156,7 +169,6 @@ pipeline { branch 'master' branch 'develop' branch 'rc/*' - branch 'w-14218793-sof' } } steps { @@ -186,7 +198,6 @@ pipeline { branch 'master' branch 'develop' branch 'rc/*' - branch 'w-14218793-sof' } } steps { diff --git a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala index f9525c4e0..c063d2db7 100644 --- a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala +++ b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala @@ -68,7 +68,7 @@ object DiagnosticConverters { head match { case (DocumentLink(range, _, _), origin) => val newD = newDiagnostic(uri, range, origin) - // avoid SOF by checking if we already added it, not using set as order is needed + // avoid timeout by checking if we already added it, not using set as order is needed if (!branch.contains(newD)) { if (originFlag) branch.prepend(newDiagnostic(uri, range, origin)) diff --git a/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala b/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala index 87396bba3..ed469177f 100644 --- a/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala +++ b/als-server/shared/src/test/scala/org/mulesoft/als/server/workspace/WorkspaceManagerTest.scala @@ -730,11 +730,8 @@ class WorkspaceManagerTest extends LanguageServerBaseTest { } } - // This test evades a SOF in AALS, here it throws timeout if it is not working - // SOF is fixed by making uniques the stored branches - // timeout is fixed by lowering the branch limit that affects the relatedInformation in relatedFor - // After fixing this 2 things, performance in APID is fixed - test("Workspace Manager OAS 3 SOF relatedFor branches case", Flaky) { + // This test throws timeout if not working + test("Workspace Manager OAS 3 SOF relatedFor branches case") { val diagnosticClientNotifier: MockDiagnosticClientNotifierWithTelemetryLog = new MockDiagnosticClientNotifierWithTelemetryLog(60000) withServer[Assertion](buildServer(diagnosticClientNotifier)) { server => diff --git a/dependencies.properties b/dependencies.properties index 06f4154d5..7d457ad8d 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1,4 +1,4 @@ -version=w-14218793-sof-100-branch-SNAPSHOT +version=6.1.0-SNAPSHOT amf=5.4.3-0 amf.custom-validator.js=1.4.0 amf.custom-validator-scalajs=0.5.3 From a9919896ad42814880730561ae1ede701388d872 Mon Sep 17 00:00:00 2001 From: BlockLucas Date: Thu, 12 Oct 2023 14:18:35 -0300 Subject: [PATCH 6/6] trivial refactor --- .../als/server/modules/diagnostic/DiagnosticConverters.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala index c063d2db7..af799417d 100644 --- a/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala +++ b/als-server/shared/src/main/scala/org/mulesoft/als/server/modules/diagnostic/DiagnosticConverters.scala @@ -71,9 +71,9 @@ object DiagnosticConverters { // avoid timeout by checking if we already added it, not using set as order is needed if (!branch.contains(newD)) { if (originFlag) - branch.prepend(newDiagnostic(uri, range, origin)) + branch.prepend(newD) else - branch.append(newDiagnostic(uri, range, origin)) + branch.append(newD) relatedFor(origin, references, informationBranches, branch, branchLimit, originFlag) } }