-
Notifications
You must be signed in to change notification settings - Fork 226
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
Migrate cadl-ranch test to main typespec repo #4015
Comments
est: 8 |
Example what it could look like function createModelMockApis(route: string, value: any[]): MockApiGetPut {
const url = `/type/array/${route}`;
return {
get: {
url,
method: "get",
request: {},
repsonse: {
status: 200,
body: json(value),
},
},
put: {
url,
method: "put",
request: {
body: json(value),
},
response: {
status: 204,
},
},
};
}
const Int32ValueMock = createModelMockApis("int32", [1, 2]);
Scenarios.Type_Array_Int32Value_get = passOnSuccess(Int32ValueMock.get);
Scenarios.Type_Array_Int32Value_put = passOnSuccess(Int32ValueMock.put); Client testing flow# Start mock server http://localhost:3000
tsp-spec server start ./node_modules/@typespec/rest-spec
npm run client:test # Run all the emitted client tests - not our problem of what this do
tsp-spec server stop
# upload coverage Server testing flownpm run start:server:apis # Start the generated server - not our problem of what this do
# Run mock client tests
tsp-spec client run ./node_modules/@typespec/rest-spec
# upload coverage Scenarios:
|
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 17, 2024
#4015 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Timothee Guerin <[email protected]> Co-authored-by: Timothee Guerin <[email protected]> Co-authored-by: m-nash <[email protected]> Co-authored-by: Kyle Zhang <[email protected]> Co-authored-by: Kyle Zhang <[email protected]> Co-authored-by: Mario Guerra <[email protected]> Co-authored-by: Crystal YU <[email protected]> Co-authored-by: Jorge Rangel <[email protected]> Co-authored-by: Mark Cowlishaw <[email protected]> Co-authored-by: Srikanta <[email protected]> Co-authored-by: Christopher Radek <[email protected]> Co-authored-by: Christopher Radek <[email protected]> Co-authored-by: Nisha Bhatia <[email protected]> Co-authored-by: Wei Hu <[email protected]> Co-authored-by: iscai-msft <[email protected]> Co-authored-by: iscai-msft <[email protected]> Co-authored-by: JoshLove-msft <[email protected]> Co-authored-by: Dapeng Zhang <[email protected]> Co-authored-by: Dapeng Zhang <[email protected]> Co-authored-by: ShivangiReja <[email protected]> Co-authored-by: ShivangiReja <[email protected]> Co-authored-by: Mingzhe Huang <[email protected]> Co-authored-by: Mingzhe Huang (from Dev Box) <[email protected]> Co-authored-by: Allen Zhang <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pan Shao <[email protected]> Co-authored-by: Pan Shao <[email protected]> Co-authored-by: Weidong Xu <[email protected]> Co-authored-by: Xiaofei Cao <[email protected]> Co-authored-by: Alan Zimmer <[email protected]> Co-authored-by: Alitzel Mendez <[email protected]> Co-authored-by: Rodge Fu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As part of having the client emitters as well as trying to reuse the specs for service emitters it would be good to have cadl-ranch be directly into typespec
Currently there is a few packages in cadl-ranch:
cadl-ranch
: Runtimecadl-ranch-expect
: Typespec library adding the custom decoratorscadl-ranch-api
: TS Api to implement the mock apicadl-ranch-dashboard
: Website codecadl-ranch-specs
: The actual specsI think we need could move and rename the following:
cadl-ranch
: Runtimecadl-ranch-expect
: Typespec library adding the custom decoratorscadl-ranch-api
: TS Api to implement the mock apiThen we can migrate the specs expect the azure ones.
The dashboard can remain there for now as it is specific to azure but that will be something that would be very nice to integrate as well
Things to figure out:
@azure-tools/cadl-ranch
@azure-tools/cadl-ranch-expect
@azure-tools/cadl-ranch-api
@azure-tools/cadl-ranch-specs
@typespec/scenario-director
@typespec/scenario-lib
@typespec/scenario-api
@typespec/http-scenarios
@typespec/tsp-cupboard
@typespec/tsp-cupboard-lib
@typespec/tsp-cupboard-api
@typespec/http-tsp-cupboard
@typespec/tsp-recipes
@typespec/tsp-ingredients
@typespec/tsp-recipes-api
@typespec/http-recipes
@typespec/spec-core
@typespec/spec
@typespec/spec
(we could reuse the same lib)@typespec/rest-spec
Other alternatives:
cabinet
instead ofcupboard
for option 2Steps
Tasks
The text was updated successfully, but these errors were encountered: