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: * Assert expected packages in runtime closure. This allows us to be alerted if a dependency introduces a new transitive depenency to the AWS CLI closure. * Assert expected unbounded dependencies in runtime closure. * Assert expected packages in build closure * Assert expected unbounded dependencies in build closure Implemenation notes: * Why it is a separate test directory * 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
492 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,34 @@ | ||
#!/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 | ||
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"{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.