asyncapi / generator

Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!
https://asyncapi.com/docs/tools/generator
Apache License 2.0
767 stars 232 forks source link

test: remove dependency to html-template in integration tests #1202

Closed derberg closed 6 months ago

derberg commented 6 months ago

The issue is that all our integration tests depended on html-template

It was fine just until this week when we did generator v2 release - and now our tests will not work until html-template actually starts supporting v2 - it is because we have a functionality that templates can define what generator versions they depend on -> https://github.com/asyncapi/java-template/blob/master/package.json#L102

This PR:

Side effect: we have local test templates that along the way we can extend with more features and extend integration tests to test more functionality.

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

derberg commented 6 months ago

@Florence-Njeri I updated readme in test folder so you need to approve as well

lmgyuan commented 6 months ago

I understand why an alternative simplistic test template is needed to replace HTML template. But my concern is that will using a local template require maintainers always to update it to avoid situations where the tests pass but the generator is not working in the actual usage? If this is temporary, and we will update the HTML template and others to support the generator v2 release, then I think using a local simplistic template for now is understandable. : ) @derberg

derberg commented 6 months ago

@lmgyuan the reality is that we did not use html-template in a way that there were some great features to test. So local templates give us more flexibility actually, more can be tested long term.

Do why we didn't do it from the beginning? I added first integration tests when there was no use case for testing installation from nom registry. So there was no use case to figure there is something like verdaccio. So I neglected local templates as templates that do not enable us to test all scenarios. Now with verdaccio it is super easy and we can test basically any scenerio.

/rtm

lmgyuan commented 6 months ago

@lmgyuan the reality is that we did not use html-template in a way that there were some great features to test. So local templates give us more flexibility actually, more can be tested long term.

Do why we didn't do it from the beginning? I added first integration tests when there was no use case for testing installation from nom registry. So there was no use case to figure there is something like verdaccio. So I neglected local templates as templates that do not enable us to test all scenarios. Now with verdaccio it is super easy and we can test basically any scenerio.

/rtm

This makes a lot of sense! Thanks for your explanation!

asyncapi-bot commented 6 months ago

:tada: This PR is included in version 2.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: