cli icon indicating copy to clipboard operation
cli copied to clipboard

We need a local server for mocking our tests.

Open Souvikns opened this issue 3 years ago • 2 comments

Reason/Context

I see that @fmvilas already reviews, so from my point of view I only suggest to log a followup issue, something good for the first contribution, to make sure tests do not rely on external resources. Basically, external resources are risky to use in tests and can cause tests to be flaky, like randomly failing just because the external resource is not available. So follow up should describe that tests should actually start independent server hosting asyncapi file, like we do in parser -> https://github.com/asyncapi/parser-js/blob/master/package.json#L20

This issue is related to https://github.com/asyncapi/cli/pull/110#discussion_r768405925

Souvikns avatar Dec 14 '21 12:12 Souvikns

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Apr 14 '22 00:04 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Aug 19 '22 00:08 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Dec 18 '22 00:12 github-actions[bot]

we should probably have a look at this one with higher priority, maybe this is the reason for some timeouts

derberg avatar Apr 03 '23 16:04 derberg

Hey @Souvikns and @derberg , from what i understood this issue is if this remote file cannot be loaded the test may fail and be flaky. Instead we want our own server locally through which we can serve the file through the server but the local file https://github.com/asyncapi/cli/blob/f2633cf9675f4ec135b2ca2e97064ddd1a97e9a7/test/commands/generate/models.test.ts#L12 and for this as @derberg suggested we can use something similar like https://github.com/asyncapi/parser-js/blob/481b24e8f6e2216d0ea5c3d9bb95c938f4736eef/test/browser/browser.spec.ts#L17-L26 Where we create a local server and serve the files. Am I right?

chinma-yyy avatar Jun 01 '23 09:06 chinma-yyy

perfectly understood! we should have a test asyncapi file inside this repo and host it temporarily on local server during tests, to test parseFromUrl. No fetching from server we do not control

derberg avatar Jun 01 '23 11:06 derberg

Cool, I will work on this issue and raise a PR soon :v:

chinma-yyy avatar Jun 01 '23 12:06 chinma-yyy

:tada: This issue has been resolved in version 0.51.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Jul 20 '23 11:07 asyncapi-bot