cap-js / ord

Open Resource Discovery (ORD) is a protocol that allows applications and services to self-describe their exposed resources and capabilities. This plugin enables generation of ORD document for CAP based applications.
Apache License 2.0
3 stars 4 forks source link

Feat: apply ord document validator in CICD pipeline #65

Open zongqichen opened 1 month ago

zongqichen commented 1 month ago

At the moment, we only have unittest to protect the result of ord default content generation. However, we need to validate the correctness of ord content by validator.

Fannon commented 1 month ago

In some other projects, I added the API Metadata Validator as an NPM dependency. Then you can call the validator programmatically (not as CLI) in your unit-tests. This will give you a better, integrated testing experience.

zongqichen commented 1 month ago

We also need to solve: https://github.com/cap-js/ord/pull/63#discussion_r1793738012

aramovic79 commented 3 weeks ago

In some other projects, I added the API Metadata Validator as an NPM dependency. Then you can call the validator programmatically (not as CLI) in your unit-tests. This will give you a better, integrated testing experience.

I remember that the recommended way of running the MetadataValidator was by using docker image. Public Artifactory: cpa-docker.common.repositories.cloud.sap/api-metadata-validator:latest Internal Artifactory: cpa-docker.cpa-docker.int.repositories.cloud.sap/api-metadata-validator:latest

Has the recommendation being changed meanwhile? I think we should decide which way is more reliable(and faster also): to run Jest tests by using, as you wrote, API Metadata Validator package or by running API Metadata Validator docker image.