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

Adds testFixturesApi and testFixturesImplementation to gradle test co… #920

Merged
merged 4 commits into from
Apr 29, 2022

Conversation

meghfossa
Copy link
Contributor

@meghfossa meghfossa commented Apr 28, 2022

Overview

With this change, fossa-cli considers,

  • testFixturesApi
  • testFixturesImplementation

to test environment configuration, and as such, they are by default excluded from fossa analysis reporting.

Acceptance criteria

  • When fossa analyze is ran on Gradle project, dependencies originating from testFixturesApi configuration are not included in final dependency graph
  • When fossa analyze is ran on Gradle project, dependencies originating from testFixturesImplementation configuration are not included in final dependency graph

Testing plan

  1. Get Gradle project (refer to Gradle official sample)
  2. Add the following to build.gradle
    // API dependencies are visible to consumers when building
    testFixturesApi 'org.apache.commons:commons-lang3:3.9'

    // Implementation dependencies are not leaked to consumers when building
    testFixturesImplementation 'org.apache.commons:commons-text:1.6'
  1. make install-dev
  2. fossa-dev analyze -o | jq (in the sourceUnit, you should not see org.apache.commons:commons-text:1.6 or org.apache.commons:commons-lang3:3.9

Risks

Per https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures, this is test configuration. This seems to be low risk.

References

#919

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an # Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).

@meghfossa meghfossa changed the title Adds testFixturesApi and testFixturesImplementation to gradle test co… [DNM] Adds testFixturesApi and testFixturesImplementation to gradle test co… Apr 28, 2022
@meghfossa meghfossa marked this pull request as ready for review April 28, 2022 14:03
@meghfossa meghfossa requested a review from a team as a code owner April 28, 2022 14:03
@meghfossa meghfossa requested a review from csasarak April 28, 2022 14:03
Copy link
Contributor

@skilly-lily skilly-lily left a comment

Choose a reason for hiding this comment

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

LGTM I think this is completely safe.

@meghfossa meghfossa force-pushed the feat/adds-test-configs-label-to-gradle branch from d83757f to 60c6b3c Compare April 29, 2022 14:53
@meghfossa meghfossa enabled auto-merge (squash) April 29, 2022 14:54
@meghfossa meghfossa changed the title [DNM] Adds testFixturesApi and testFixturesImplementation to gradle test co… Adds testFixturesApi and testFixturesImplementation to gradle test co… Apr 29, 2022
@meghfossa meghfossa merged commit 693e703 into master Apr 29, 2022
@meghfossa meghfossa deleted the feat/adds-test-configs-label-to-gradle branch April 29, 2022 15:18
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