-
Notifications
You must be signed in to change notification settings - Fork 0
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
Updated testcases related to Origins API #2
base: main
Are you sure you want to change the base?
Conversation
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.
Great job! This looks really nice and clean!
case 'conda': | ||
return `conda/${provider}` | ||
case 'maven': | ||
return provider === 'mavengoogle' ? provider : type |
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.
what about maven for mavencentral, mavengoogle and gradleplugin is the same as provider?
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.
case 'git':
case 'gem':
return provider
What do you think?
it('Validates Origins API response for a Maven component with a partial group ID for suggestion checks', () => | ||
compareOrigins(MAVEN_COMPONENT_PARTIAL_GROUP_ID)) | ||
|
||
it('Validates Origins API response for a Gradle plugin component', () => |
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.
why do we have to separate gradle components?
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.
I have used separate test cases for gradle since the endpoint for it is origins/gradleplugin/:pluginID where pluginID is not consistent with the name of group id or artefact id like
Here is the case where pluginId is combination of group id and artefact id
https://plugins.gradle.org/plugin/io.outfoxx.sunday-generator
https://mvnrepository.com/artifact/io.outfoxx.sunday/generator
Here is the case where pluginId is only group id -
https://plugins.gradle.org/plugin/io.github.lognet.grpc-spring-boot
https://mvnrepository.com/artifact/io.github.lognet.grpc-spring-boot/io.github.lognet.grpc-spring-boot.gradle.plugin
Please let me know if I could handle this better. Most of the cases corresponds pluginId to group id. In that case we would also need to add another buildurl function for gradleplugin.
assertOriginsMatch(devResponse, prodResponse) | ||
async function compareOrigins(coordinates) { | ||
const originUrl = coordinates.startsWith('conda/') ? buildCondaUrl(coordinates) : buildOriginUrl(coordinates) | ||
compareEndpoints(`${originUrl}`) |
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.
await needs to be added
]) | ||
async function compareOriginsWithRevisions(coordinates) { | ||
const originUrl = buildOriginUrl(coordinates) | ||
compareEndpoints(`${originUrl}/revisions`) |
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.
await needs to be added
No description provided.