forked from aws/aws-cli
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. * Assert expected packages used in building the awscli package and any of its runtime dependencies. Specifically, this targets the use case of a user installing the awscli (and all of its dependencies) from sdist as it will capture which build packages are pulled into the isolated virtual environment when building the package. * Assert expected unbounded dependencies in building the awscli package and any of its runtime dependencies. This helps monitor out of all of the build packages used, which ones may have no version ceiling when installed into an isolated virutal environment See additional implementation notes below: * Why it is a separate test directory * Do not block builds * Note how to figure it out for runtime dependencies * Note how to figure out for build dependencies
- Loading branch information
Showing
6 changed files
with
506 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Run dependency tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches-ignore: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: python scripts/ci/install | ||
- name: Run tests | ||
run: python scripts/ci/run-dep-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
# Don't run tests from the root repo dir. | ||
# We want to ensure we're importing from the installed | ||
# binary package not from the CWD. | ||
|
||
import os | ||
import sys | ||
from contextlib import contextmanager | ||
from subprocess import check_call | ||
|
||
_dname = os.path.dirname | ||
|
||
REPO_ROOT = _dname(_dname(_dname(os.path.abspath(__file__)))) | ||
|
||
|
||
@contextmanager | ||
def cd(path): | ||
"""Change directory while inside context manager.""" | ||
cwd = os.getcwd() | ||
try: | ||
os.chdir(path) | ||
yield | ||
finally: | ||
os.chdir(cwd) | ||
|
||
|
||
def run(command): | ||
env = os.environ.copy() | ||
env['TESTS_REMOVE_REPO_ROOT_FROM_PATH'] = 'true' | ||
return check_call(command, shell=True, env=env) | ||
|
||
|
||
if __name__ == "__main__": | ||
with cd(os.path.join(REPO_ROOT, "tests")): | ||
run(f"{sys.executable} {REPO_ROOT}/scripts/ci/run-tests dependencies") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. |
Oops, something went wrong.