Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .chronus/changes/scenario-tiers-2025-11-19-13-57-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
changeKind: feature
packages:
- "@typespec/http-specs"
- "@typespec/spec-coverage-sdk"
- "@typespec/spector"
---

Add scenario tier support to categorize scenarios as "core" or "extended"

- Add `@scenarioTier` decorator to TypeSpec HTTP specs for better test organization
- Update spec dashboard to support tier-based filtering of scenarios
- Enable teams to focus on core functionality testing before extended features
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ using Spector;
@scenarioService("/authentication/api-key")
@doc("Illustrates clients generated with ApiKey authentication.")
@useAuth(ApiKeyAuth<ApiKeyLocation.header, "x-ms-api-key">)
@scenarioTier("core")
namespace Authentication.ApiKey;

@scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using TypeSpec.Http;
using Spector;

@scenarioService("/authentication/http/custom")
@scenarioTier("core")
@doc("Illustrates clients generated with generic HTTP auth.")
@useAuth({
type: AuthType.http,
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/authentication/oauth2/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using Http;
using Spector;

@scenarioService("/authentication/oauth2")
@scenarioTier("core")
@doc("Illustrates clients generated with OAuth2 authentication.")
@useAuth(OAuth2Auth<[MyFlow]>)
namespace Authentication.OAuth2;
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/authentication/union/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using Http;
using Spector;

@scenarioService("/authentication/union")
@scenarioTier("core")
@doc("Illustrates clients generated with ApiKey and OAuth2 authentication.")
@useAuth(ApiKeyAuth<ApiKeyLocation.header, "x-ms-api-key"> | OAuth2Auth<[MyFlow]>)
namespace Authentication.Union;
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/encode/bytes/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for encode decorator on bytes.")
@scenarioService("/encode/bytes")
@scenarioTier("core")
namespace Encode.Bytes;

@encode(BytesKnownEncoding.base64url)
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/encode/datetime/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for encode decorator on datetime.")
@scenarioService("/encode/datetime")
@scenarioTier("core")
namespace Encode.Datetime;

@encode(DateTimeKnownEncoding.unixTimestamp, int64)
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/encode/duration/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for encode decorator on duration.")
@scenarioService("/encode/duration")
@scenarioTier("core")
namespace Encode.Duration;

@route("/query")
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/encode/numeric/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for encode decorator on integer.")
@scenarioService("/encode/numeric")
@scenarioTier("core")
namespace Encode.Numeric;

@route("/property")
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/parameters/basic/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for basic parameters cases.")
@scenarioService("/parameters/basic")
@scenarioTier("core")
namespace Parameters.Basic;

@route("/explicit-body")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test describing optionality of the request body.")
@scenarioService("/parameters/body-optionality")
@scenarioTier("core")
namespace Parameters.BodyOptionality;

model BodyModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for collectionFormat.")
@scenarioService("/parameters/collection-format")
@scenarioTier("core")
namespace Parameters.CollectionFormat;

@route("/query")
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/parameters/path/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for path parameters cases.")
@scenarioService("/parameters/path")
@scenarioTier("core")
namespace Parameters.Path;

@scenario
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/parameters/spread/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for the spread operator.")
@scenarioService("/parameters/spread")
@scenarioTier("core")
namespace Parameters.Spread;

@route("/model")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test describing optionality of the request body.")
@scenarioService("/content-negotiation")
@scenarioTier("core")
namespace Payload.ContentNegotiation;

@scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for merge-patch+json content-type")
@scenarioService("/json-merge-patch")
@scenarioTier("extended")
namespace Payload.JsonMergePatch;

@doc("Details about a resource.")
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/payload/media-type/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Spector;
* Test the payload with different media types and different types of the payload itself.
*/
@scenarioService("/payload/media-type")
@scenarioTier("core")
namespace Payload.MediaType;

@route("/string-body")
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/payload/multipart/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Test for multipart")
@scenarioService("/multipart")
@scenarioTier("core")
namespace Payload.MultiPart;

model MultiPartRequest {
Expand Down
5 changes: 5 additions & 0 deletions packages/http-specs/specs/payload/pageable/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ alias HeaderAndQuery = {
@route("/server-driven-pagination")
namespace ServerDrivenPagination {
@scenario
@scenarioTier("core")
@scenarioDoc("""
Test case for using link as pagination.

Expand Down Expand Up @@ -142,6 +143,7 @@ namespace ServerDrivenPagination {
@route("/continuationtoken")
namespace ContinuationToken {
@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test case for using continuation token as pagination. Continuation token is passed in the request query and response body.

Expand Down Expand Up @@ -188,6 +190,7 @@ namespace ServerDrivenPagination {
};

@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test case for using continuation token as pagination. Continuation token is passed in the request header and response body.

Expand Down Expand Up @@ -235,6 +238,7 @@ namespace ServerDrivenPagination {
};

@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test case for using continuation token as pagination. Continuation token is passed in the request query and response header.

Expand Down Expand Up @@ -283,6 +287,7 @@ namespace ServerDrivenPagination {
};

@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test case for using continuation token as pagination. Continuation token is passed in the request header and response header.

Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/payload/xml/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using TypeSpec.Xml;

@doc("Sends and receives bodies in XML format.")
@scenarioService("/payload/xml")
@scenarioTier("extended")
namespace Payload.Xml;

@doc("Contains fields of primitive types.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Spector;
* Test for range of status code.
*/
@scenarioService("/response/status-code-range")
@scenarioTier("extended")
namespace Response.StatusCodeRange;

@scenario
Expand Down
20 changes: 20 additions & 0 deletions packages/http-specs/specs/routes/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using Spector;
namespace Routes;

@scenario
@scenarioTier("core")
@scenarioDoc("""
Simple operation at a fixed in an interface
Expected path: /routes/fixed
Expand All @@ -19,6 +20,7 @@ namespace Routes;
op fixed(): void;

@scenario
@scenarioTier("core")
@scenarioDoc("""
Simple operation at a fixed in an interface
Expected path: /routes/in-interface/fixed
Expand All @@ -32,6 +34,7 @@ interface InInterface {
@route("path")
namespace PathParameters {
@scenario
@scenarioTier("core")
@scenarioDoc("""
Path parameter defined implicitly
Value: "a"
Expand All @@ -41,6 +44,7 @@ namespace PathParameters {
op templateOnly(param: string): void;

@scenario
@scenarioTier("core")
@scenarioDoc("""
Path parameter defined explicitly
Value: "a"
Expand All @@ -50,6 +54,7 @@ namespace PathParameters {
op explicit(@path param: string): void;

@scenario
@scenarioTier("core")
@scenarioDoc("""
Path parameter annotated with @path but not defined explicitly in the route
Value: "a"
Expand All @@ -59,6 +64,7 @@ namespace PathParameters {
op annotationOnly(@path param: string): void;

@route("reserved-expansion")
@scenarioTier("extended")
namespace ReservedExpansion {
@scenario
@scenarioDoc("""
Expand All @@ -80,6 +86,7 @@ namespace PathParameters {
}

@route("simple")
@scenarioTier("extended")
namespace SimpleExpansion {
@route("standard")
namespace Standard {
Expand Down Expand Up @@ -143,6 +150,7 @@ namespace PathParameters {
}

@route("path")
@scenarioTier("extended")
namespace PathExpansion {
@route("standard")
namespace Standard {
Expand Down Expand Up @@ -206,6 +214,7 @@ namespace PathParameters {
}

@route("label")
@scenarioTier("extended")
namespace LabelExpansion {
@route("standard")
namespace Standard {
Expand Down Expand Up @@ -269,6 +278,7 @@ namespace PathParameters {
}

@route("matrix")
@scenarioTier("extended")
namespace MatrixExpansion {
@route("standard")
namespace Standard {
Expand Down Expand Up @@ -335,21 +345,25 @@ namespace PathParameters {
@route("query")
namespace QueryParameters {
@scenario
@scenarioTier("core")
@scenarioDoc("Query parameter defined implicitly")
@route("template-only{?param}")
op templateOnly(param: string): void;

@scenario
@scenarioTier("core")
@scenarioDoc("Query parameter marked with explicit @query")
@route("explicit{?param}")
op explicit(@query param: string): void;

@scenario
@scenarioTier("core")
@scenarioDoc("Query parameter annotated with @query but not defined explicitly in the route")
@route("annotation-only")
op annotationOnly(@query param: string): void;

@route("query-expansion")
@scenarioTier("extended")
namespace QueryExpansion {
@route("standard")
namespace Standard {
Expand Down Expand Up @@ -417,6 +431,7 @@ namespace QueryParameters {
@route("standard")
namespace Standard {
@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test query continuation expansion with explode: false when passed a primitive value.
Param value: "a"
Expand All @@ -426,6 +441,7 @@ namespace QueryParameters {
op primitive(param: string): void;

@scenario
@scenarioTier("core")
@scenarioDoc("""
Test query continuation expansion with explode: false when passed an array value.
Param value: ["a","b"]
Expand All @@ -435,6 +451,7 @@ namespace QueryParameters {
op `array`(param: string[]): void;

@scenario
@scenarioTier("core")
@scenarioDoc("""
Test query continuation expansion with explode: false when passed a record value.
Param value: {a: 1, b: 2}
Expand All @@ -447,6 +464,7 @@ namespace QueryParameters {
@route("explode")
namespace Explode {
@scenario
@scenarioTier("core")
@scenarioDoc("""
Test query continuation expansion with explode: true when passed a primitive value.
Param value: "a"
Expand All @@ -456,6 +474,7 @@ namespace QueryParameters {
op primitive(param: string): void;

@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test query continuation expansion with explode: true when passed an array value.
Param value: ["a","b"]
Expand All @@ -465,6 +484,7 @@ namespace QueryParameters {
op `array`(param: string[]): void;

@scenario
@scenarioTier("extended")
@scenarioDoc("""
Test query continuation expansion with explode: true when passed a record value.
Param value: {a: 1, b: 2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Spector;

@doc("Encoded names")
@scenarioService("/serialization/encoded-name/json")
@scenarioTier("core")
namespace Serialization.EncodedName.Json;

@route("/property")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using Spector;
*/
@route("/server/endpoint/not-defined")
@service(#{ title: "Testserver without any endpoint" })
@scenarioTier("core")
namespace Server.Endpoint.NotDefined;

@scenario
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/server/path/multiple/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ using Rest;
apiVersion: Versions,
}
)
@scenarioTier("core")
namespace Server.Path.Multiple;

@doc("Service versions")
Expand Down
1 change: 1 addition & 0 deletions packages/http-specs/specs/server/path/single/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using Spector;
}
)
@route("/server/path/single")
@scenarioTier("core")
namespace Server.Path.Single;

@scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ using Spector;
}
)
@route("/server/versions/not-versioned")
@scenarioTier("core")
namespace Server.Versions.NotVersioned;

@scenario
Expand Down
Loading
Loading