movary icon indicating copy to clipboard operation
movary copied to clipboard

Refactor testing pipeline

Open JVT038 opened this issue 4 months ago • 3 comments

I have generated HTTP tests for all endpoints defined in the OpenAPI specs.

Used command:

docker run --rm \
    -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
    -i /local/docs/openapi.json \
    -g jetbrains-http-client \
    -o /local/movaryClient \
    --skip-validate-spec

I think the addition of @name is a good one, because it makes it easier for us to see which tests have failed / passed.

Besides that, this PR can be used as a start to test all the endpoints, because we can now just copy-paste the very basics into the tests/rest/api directory (where we'll be placing the actual tests).

I have also changed the testing workflow, renaming run_tests to run_php_tests and adding run_http_tests which should automatically run all the HTTP tests in the HTTP directory (not tested if this works though).

This PR is just a draft, meant as an example, not as an actual solution.

Some references:

  • https://openapi-generator.tech/#try
  • https://github.com/jlengrand/dotaClient?ref=lengrand.fr
  • https://lengrand.fr/replacing-postman-in-seconds-with-the-jetbrains-http-client/
  • https://openapi-generator.tech/docs/generators/jetbrains-http-client/
  • https://docs.github.com/en/actions/creating-actions/about-custom-actions
  • https://github.com/actions/checkout/issues/956
  • https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container

JVT038 avatar Feb 27 '24 12:02 JVT038