Skip to content

Conversation

@chlowell
Copy link
Member

Closes #8654. Examples of the new format: azblob, azcore

I fixed a bug in today's parser that creates duplicate types for aliases, however this PR doesn't address other bugs or feature gaps. I haven't found anything newly broken by this PR.

This PR also closes #3142 by adding a new test that generates JSON output and fails when that changes.

@chlowell chlowell marked this pull request as ready for review November 20, 2024 22:48
Copy link
Member

@RickWinter RickWinter left a comment

Choose a reason for hiding this comment

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

Is there any coverage data or apiview scenario coverage data?

@chlowell
Copy link
Member Author

Is there any coverage data or apiview scenario coverage data?

We can generate coverage for unit tests but that's statement coverage (currently 89.3%), not useful here because there are so many conditions. We can validate our output against the JSON schema (have done) but there's no scenario coverage a la codegen, I guess because there's no consistency in input (source code) across parsers.

I suppose someone could write language-agnostic tests validating JSON details like "all LineId values are unique" and "all NavigateToId values are also LineId values". @praveenkuttappan, what do you think?

@chlowell chlowell added the APIView Issues related to APIView core functionality or UI label Nov 21, 2024
@chlowell chlowell added the Go label Nov 21, 2024
@praveenkuttappan
Copy link
Member

Is there any coverage data or apiview scenario coverage data?

We can generate coverage for unit tests but that's statement coverage (currently 89.3%), not useful here because there are so many conditions. We can validate our output against the JSON schema (have done) but there's no scenario coverage a la codegen, I guess because there's no consistency in input (source code) across parsers.

I suppose someone could write language-agnostic tests validating JSON details like "all LineId values are unique" and "all NavigateToId values are also LineId values". @praveenkuttappan, what do you think?

We already have tests in APIView that covers language independent JSON validation for all scenarios in both UI and server side. But it will still be better to have some tests in the parser to ensure basic test cases that json is generated as expected from parser.

One basic validation you can add in parser side is to ensure generated json is as per the JSON schema.

@chlowell chlowell enabled auto-merge (squash) December 6, 2024 20:16
@chlowell chlowell merged commit e199ffa into Azure:main Dec 6, 2024
8 checks passed
@chlowell chlowell deleted the tree branch December 6, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APIView Issues related to APIView core functionality or UI Go

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

apiviewgo supports tree tokens Add apiviewgo tests

5 participants