-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@azure-tools/cadl-ranch-specs] - Add Scenarios for Server Tests and Testing Framework #729
Conversation
🦋 Changeset detectedLatest commit: 897ff94 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/cadl-ranch-specs/http/authentication/http/custom/mockapi.ts
Dismissed
Show dismissed
Hide dismissed
packages/cadl-ranch-specs/http/authentication/http/custom/mockapi.ts
Dismissed
Show dismissed
Hide dismissed
packages/cadl-ranch-specs/http/authentication/oauth2/mockapi.ts
Dismissed
Show dismissed
Hide dismissed
packages/cadl-ranch-specs/http/authentication/union/mockapi.ts
Dismissed
Show dismissed
Hide dismissed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that PR be in the typespec repo?
@timotheeguerin The original plan is to make the changes here and then port this package completely to the typespec repository. Do you agree? Do you want the changes only in Typespec repo i.e. migrate the cadl-ranch-specs repository with the new code changes in this PR? Please let me know. |
sure as long as the change you make here are completely back compatible |
They are backward compatible. None of the existing scenarios will be affected |
return `${this.getImportContents()}\n${this.getGlobalDeclarationContents()}\n${this.getDescribeContents()}`; | ||
} | ||
|
||
public async generateFile() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very weird to resort to that, why not directly run things, this is going to make debugging impossible.
I don't feel like there is much point running vitest as well on top or any other test runner. We won't use the language for the test runner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timotheeguerin This actually generates the spec files that could be run using the vitest. Any errors could be seen directly in the generated spec files. So, the debugging should be simple enough. Dont you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this just feels like a lot of pain to maintain regardless, now if we need to add some more complex scenario you don't need to just make the call yourself you need to reserialize that code to a file(the whole request creation that is currently hardcoded in that file).
What is the benefit of using a test runner here? I think it would be much better to just have the cli and if having vitest IDE support is important then you call to vitest api directly without shelkling a new process and writing new files.
… repository with server tests and framework (#4516) This PR has the following changes: 1. Migrates the `cadl-ranch-specs ` package from the `cadl-ranch` repository to this `typespec` repository. 2. Adds the server-test scenarios along with the framework to test those scenarios. In order to test the new server-test scenarios, there are 3 modes enabled: 1. Specify the name of one scenario in the command line. 2. Specify the list of scenarios to be tested in a file and provide this file as input in the command line 3. If the above modes are not specified, then the framework will execute all the scenarios. **Mode 1 - One Scenario in Command Line** ![Screenshot 2024-09-23 150451](https://github.com/user-attachments/assets/cd43c07c-1b37-4d5c-bd33-02c59e3539d1) **Mode 2 - Multiple Scenarios in file** ![Screenshot 2024-09-23 150615](https://github.com/user-attachments/assets/7b6be4f3-566d-48f4-bd36-cbbb91078339) **Mode 3 - All Scenarios** ![Screenshot 2024-09-23 150636](https://github.com/user-attachments/assets/40263bf8-2cbb-4e4c-85ea-f1af634c6f42) ![Screenshot 2024-09-23 150749](https://github.com/user-attachments/assets/0d7fd055-de13-42f4-a4d6-85b837fec1e9) This PR is equivalent of the PR Azure/cadl-ranch#729. Except for some cosmetic changes in imports, etc, the code changes are same. I am doing the changes in both to ensure both are in sync.
This PR is no longer required. Closing it |
This PR adds the server-test scenarios along with the framework to test those scenarios.
In order to test the new server-test scenarios, there are 3 modes enabled:
Mode 1 - One Scenario in Command Line
Mode 2 - Multiple Scenarios in file
Mode 3 - All Scenarios
This PR is equivalent of the PR microsoft/typespec#4516. Except for some cosmetic changes in imports, etc, the code changes are same. I am doing the changes in both to ensure both are in sync.