Skip to content
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

Added test plan for TypeSpec extension #5552

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

xiaohua899
Copy link

Description

Added six test scenarios test plan to TypeSpec Extension:

  • create-typespec-project-test-plan.md
  • generate-client-code-from-typespec-test-plan.md
  • generate-openapi3-from-typespec-test-plan.md
  • generate-server-stub-from-typespec-test-plan.md
  • import-typespec-from-openapi3-test-plan.md
  • typespec-extension-basic-features-test-plan.md

@msyyc for notification.

@microsoft-github-policy-service microsoft-github-policy-service bot added the ide Issues for VS, VSCode, Monaco, etc. label Jan 9, 2025
@xiaohua899 xiaohua899 force-pushed the patch-1 branch 2 times, most recently from deb90af to f01671f Compare January 9, 2025 11:29
Create image

Add files via upload

Update create-typespec-project-test-plan.md

Create generate-client-code-from-typespec-test-plan.md

Add files via upload

Update generate-client-code-from-typespec-test-plan.md

Create generate-openapi3-from-typespec-test-plan.md

Add files via upload

Update generate-openapi3-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Create generate-server-stub-from-typespec-test-plan.md

Add files via upload

Update generate-server-stub-from-typespec-test-plan.md

Add files via upload

Create import-typespec-from-openapi3-test-plan.md
Update generate-server-stub-from-typespec-test-plan.md

Update create-typespec-project-test-plan.md

Create typespec-extension-basic-features-test-plan.md

Add files via upload

Update typespec-extension-basic-features-test-plan.md

Update typespec-extension-basic-features-test-plan.md

Add files via upload

Update create-typespec-project-test-plan.md

Update generate-client-code-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Add files via upload

Update generate-server-stub-from-typespec-test-plan.md

Update import-typespec-from-openapi3-test-plan.md

Update create-typespec-project-test-plan.md

Update generate-client-code-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Add files via upload

Update generate-client-code-from-typespec-test-plan.md

Add files via upload

Update typespec-extension-basic-features-test-plan.md

Update typespec-extension-basic-features-test-plan.md

Update generate-client-code-from-typespec-test-plan.md

Update generate-openapi3-from-typespec-test-plan.md

Update create-typespec-project-test-plan.md

Add files via upload

Update generate-openapi3-from-typespec-test-plan.md
@xiaohua899
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@markcowl markcowl self-assigned this Jan 9, 2025
@RodgeFu RodgeFu self-assigned this Jan 11, 2025
* Empty Project
* Generic REST API
* TypeSpec Library (with TypeScript)
* TypeSpec Emitter (with TypeScript)
Copy link
Contributor

@RodgeFu RodgeFu Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the templates are loaded from compiler which may change when compiler changes. Please run 'tsp init' to get the latest templates as baseline.


![alt text](./images/TriggerCreateTypeSpecProject_CommandPalette.png)

### Step 3. Select an empty folder as the root folder for the new TypeSpec project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also try an non-empty folder which will trigger a confirmation step to confirm with end user about the selected folder


![alt text](./images/CreateTypeSpecProject_SelectFolderTest.png)

### Step 4. Check if TypeSpec Compiler CLI is install. (optional)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are three path here,

  1. The compiler has been installed locally (and the local one should be used even when compiler is also installed globally)
  2. The compiler has been installed globally
  3. not-installed (which will trigger the compiler installation step).
    Please make sure these three path are covered.


- For `TypeSpec Emitter (With TypeScript)`, the folder structure.

![alt text](./images/CreateTypeSpecProject_CreateSucceedFolder_TypeSpecEmitter.png)
Copy link
Contributor

@RodgeFu RodgeFu Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More init template can be configured. Please add one test case for that

  1. config settings 'initTemplatesUrls' as below
    "typespec.initTemplatesUrls": [
    {
    "name": "Azure",
    "url": "https://aka.ms/typespec/azure-init"
    }
    ]
  2. More templates will be loaded from the url and shown in the list like below
    image


- #### For Code completion:

Start typing keywords in the file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please test completion for both tsp file and tspconfig.yaml file.


## Test Steps

### Step 1: Install the typespec extension.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the user scenario in the spec is out-of-date. You can check the latest UI/User experience at #5451


![alt text](./images/GeneratefromTypeSpec_SelectTypespecProject.png)

### Step 4: Select an Emitter Type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the UI will be a little different after Compiler can provide template for default emitters. Will keep you updated.

@@ -0,0 +1,102 @@
# Generate OpenAPI 3.x from TypeSpec Test Scenario
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can merge the client, server stub and openapi3 user scenario into one, they are basically the same except choosing different emitters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants