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

Introduce dependency test suite for runtime closure #8512

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

kyleknap
Copy link
Contributor

The plan is to build out this test suite to test against the AWS CLI's dependencies to help facilitate dependency upgrades.

To start, this test suite contains the following new test cases to better monitor the overall dependency closure of the awscli package:

  • Assert expected packages in runtime closure. This will alert us if a dependency introduces a new transitive depenency to the AWS CLI closure.

  • Assert expected unbounded dependencies in runtime closure. Specifically these are dependencies that do not have a version ceiling. This will alert us if a new unbounded dependency is introduced into the AWS CLI runtime dependency closure.

See additional implementation notes below:

  • These tests were broken into a separate test suite (i.e. instead of adding them to the unit and functional test suite) to allow more granularity when running them. Specifically, it is useful for:

    1. Avoiding the main unit and functional CI test suite from failing if a dependency changes from underneath of us (e.g. a new build dependency is added that we cannot control).

    2. For individuals that package the awscli, they generally will not want to run this test suite as it is fairly specific to how pip installs dependencies.

  • To determine the runtime dependency closure, the Package and DependencyClosure utilities traverse the dist-info METADATA files of the packages installed in the current site packages to build the runtime graph. This approach was chosen because:

    1. Since pip already installed the package, this logic avoids having to reconstruct the logic of how pip decides to resolve dependencies to figure out how to traverse the runtime graph. Any custom logic may deviate from how pip behaves which is what most users will be using to install the awscli as a Python package
    2. It's faster. The runtime closure test cases do not require downloading or installing any additional packages.

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a0d2a4f) 0.08% compared to head (555acb8) 0.08%.
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #8512   +/-   ##
=======================================
  Coverage     0.08%   0.08%           
=======================================
  Files          208     208           
  Lines        16706   16706           
=======================================
  Hits            14      14           
  Misses       16692   16692           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

Minor nit but otherwise looks good.

.github/workflows/run-dep-tests.yml Outdated Show resolved Hide resolved
The plan is to build out this test suite to test against the AWS
CLI's dependencies to help facilitate dependency upgrades.

To start, this test suite contains the following new test cases
to better monitor the overall dependency closure of the awscli
package:

* Assert expected packages in runtime closure. This will alert
  us if a dependency introduces a new transitive depenency
  to the AWS CLI closure.

* Assert expected unbounded dependencies in runtime closure.
  Specifically these are dependencies that do not have a version
  ceiling. This will alert us if a new unbounded dependency is
  introduced into the AWS CLI runtime dependency closure.

See additional implementation notes below:

* These tests were broken into a separate test suite (i.e. instead
  of adding them to the unit and functional test suite) to allow
  more granularity when running them. Specifically, it is useful for:

  1. Avoiding the main unit and functional CI test suite from failing
     if a dependency changes from underneath of us (e.g. a new build
     dependency is added that we cannot control).

  2. For individuals that package the awscli, they generally will not
     want to run this test suite as it is fairly specific to how pip
     installs dependencies.

* To determine the runtime dependency closure, the Package and DependencyClosure
  utilities traverse the dist-info METADATA files of the packages installed in
  the current site packages to build the runtime graph. This approach was chosen
  because:

  1. Since pip already installed the package, this logic avoids having to
     reconstruct the logic of how pip decides to resolve dependencies to figure
     out how to traverse the runtime graph. Any custom logic may deviate from
     how pip behaves which is what most users will be using to install the awscli
     as a Python package
  2. It's faster. The runtime closure test cases do not require downloading or
     installing any additional packages.
@kyleknap kyleknap merged commit af5976b into aws:develop Jan 30, 2024
30 checks passed
@kyleknap kyleknap deleted the test-runtime-deps branch January 30, 2024 18:35
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.

3 participants