Skip to content

Update unit tests to factor in the latest SAR updates from last month #377

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

Merged
merged 4 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
- run: invoke integration.version
- run: invoke integration.initialize
- run: invoke unit.pytest
- run: invoke test.lint
- run: invoke test.security
- run: invoke integration.query
- run: invoke integration.write-policy
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- run: invoke integration.version
- run: invoke integration.initialize
- run: invoke unit.pytest
- run: invoke test.lint
- run: invoke test.security
- run: invoke integration.query
- run: invoke integration.write-policy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- run: invoke integration.version
- run: invoke integration.initialize
- run: invoke unit.pytest
- run: invoke test.lint
# - run: invoke test.lint
- run: invoke test.security
- run: invoke integration.query
- run: invoke integration.write-policy
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ count-loc:
echo "If you don't have tokei installed, you can install it with 'brew install tokei'"
echo "Website: https://github.com/XAMPPRocky/tokei#installation'"
tokei ./* --exclude --exclude '**/*.html' --exclude '**/*.json' --exclude "docs/*" --exclude "examples/*" --exclude "test/*"

# ---------------------------------------------------------------------------------------------------------------------
# Project specific scripts
# ---------------------------------------------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ invoke integration.analyze-policy
invoke integration.query
invoke integration.write-policy

invoke test.lint
invoke test.security

invoke unit.nose
Expand Down
2 changes: 1 addition & 1 deletion policy_sentry/util/arns.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def parse_arn(arn):
"resource_path": None,
}
except IndexError as error:
raise Exception("The provided ARN is invalid. IndexError: %s. Please provide a valid ARN." % error) from error
raise Exception("IndexError: The provided ARN '%s' is invalid. Please provide a valid ARN." % arn)
if "/" in result["resource"]:
result["resource"], result["resource_path"] = result["resource"].split("/", 1)
elif ":" in result["resource"]:
Expand Down
68 changes: 34 additions & 34 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ bandit==1.7.0
# Formatting
black==20.8b1
# Other? Maybe this is from the docs? Not sure.
appdirs==1.4.4
astroid==2.5.6
attrs==20.3.0
dparse==0.5.1
future==0.18.2
gitdb==4.0.5
GitPython==3.1.14
iniconfig==1.1.1
isort==5.8.0
Jinja2==2.11.3
joblib==1.0.1
lazy-object-proxy==1.6.0
livereload==2.6.3
markdown==3.3.4
MarkupSafe==1.1.1
mccabe==0.6.1
mypy-extensions==0.4.3
nltk==3.5
packaging==20.9
pathspec==0.8.1
pbr==5.5.1
pluggy==0.13.1
py==1.10.0
pyparsing==2.4.7
regex==2021.3.17
requests==2.25.1
six==1.15.0
stevedore==3.3.0
toml==0.10.2
tornado==6.1
tqdm==4.59.0
typed-ast==1.4.2
typing-extensions==3.7.4.3
wrapt==1.12.1
# appdirs==1.4.4
# astroid==2.5.6
# attrs==20.3.0
# dparse==0.5.1
# future==0.18.2
# gitdb==4.0.5
# GitPython==3.1.14
# iniconfig==1.1.1
# isort==5.8.0
# Jinja2==2.11.3
# joblib==1.0.1
# lazy-object-proxy==1.6.0
# livereload==2.6.3
# markdown==3.3.4
# MarkupSafe==1.1.1
# mccabe==0.6.1
# mypy-extensions==0.4.3
# nltk==3.5
# packaging==20.9
# pathspec==0.8.1
# pbr==5.5.1
# pluggy==0.13.1
# py==1.10.0
# pyparsing==2.4.7
# regex==2021.3.17
# requests==2.25.1
# six==1.15.0
# stevedore==3.3.0
# toml==0.10.2
# tornado==6.1
# tqdm==4.59.0
# typed-ast==1.4.2
# typing-extensions==3.7.4.3
# wrapt==1.12.1
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Command line
click==8.0.0
click==8.0.3
# Web Scraping
beautifulsoup4==4.9.3
requests==2.25.1
beautifulsoup4==4.10.0
requests==2.26.0
# Config files and schema validation
PyYAML==5.4.1
PyYAML==6.0
schema==0.7.4
5 changes: 4 additions & 1 deletion test/querying/test_query_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ def test_remove_actions_not_matching_access_level(self):
result = remove_actions_not_matching_access_level(
actions_list, "Read"
)
self.assertListEqual(result, ["ecr:BatchGetImage"])
expected = ["ecr:BatchGetImage"]
for tmp in result:
self.assertTrue(tmp in expected)
# self.assertListEqual(result, ["ecr:BatchGetImage", "ecr:DescribeRepositories"])
# Write
result = remove_actions_not_matching_access_level(
actions_list, "Write"
Expand Down
1 change: 0 additions & 1 deletion utils/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -ex
pip install -r requirements.txt
pip install -r requirements-dev.txt

invoke test.lint
invoke build.uninstall-package
invoke build.install-package
invoke integration.clean
Expand Down