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

Updated testcases related to Origins API #2

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

Conversation

yashkohli88
Copy link
Owner

No description provided.

Copy link

@qtomlinson qtomlinson left a 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

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?

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', () =>

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?

Copy link
Owner Author

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}`)
Copy link
Owner Author

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`)
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants