Skip to content

Commit f28edf7

Browse files
authored
chore: Update integration tests (bridgecrewio#5729)
Update integration tests
1 parent faba7d3 commit f28edf7

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

integration_tests/prepare_data.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ fi
3131

3232
if [[ "$2" == "3.8" && "$1" == "ubuntu-latest" ]]
3333
then
34-
pipenv run checkov -s -f terragoat/terraform/aws/s3.tf --bc-api-key $BC_KEY > checkov_report_s3_singlefile_api_key_terragoat.txt
35-
pipenv run checkov -s -d terragoat/terraform/azure/ --bc-api-key $BC_KEY > checkov_report_azuredir_api_key_terragoat.txt
36-
pipenv run checkov -s -d terragoat/terraform/azure/ --skip-results-upload --bc-api-key $BC_KEY > checkov_report_azuredir_api_key_terragoat_no_upload.txt
34+
pipenv run checkov -s -f terragoat/terraform/aws/s3.tf --repo-id checkov/integration_test --bc-api-key $BC_KEY > checkov_report_s3_singlefile_api_key_terragoat.txt
35+
pipenv run checkov -s -d terragoat/terraform/azure/ --repo-id checkov/integration_test --bc-api-key $BC_KEY > checkov_report_azuredir_api_key_terragoat.txt
36+
pipenv run checkov -s -d terragoat/terraform/azure/ --repo-id checkov/integration_test --skip-results-upload --bc-api-key $BC_KEY > checkov_report_azuredir_api_key_terragoat_no_upload.txt
3737
echo "running image referencing"
38-
pipenv run checkov -s -d integration_tests/example_workflow_file/.github/workflows/ -o json --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_workflow_cve.json
39-
pipenv run checkov -s -d integration_tests/example_workflow_file/bitbucket/ -o json --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_bitbucket_pipelines_cve.json
38+
pipenv run checkov -s -d integration_tests/example_workflow_file/.github/workflows/ -o json --repo-id checkov/integration_test --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_workflow_cve.json
39+
pipenv run checkov -s -d integration_tests/example_workflow_file/bitbucket/ -o json --repo-id checkov/integration_test --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_bitbucket_pipelines_cve.json
4040
echo "running list"
4141
pipenv run checkov --list --bc-api-key $BC_KEY --output-bc-ids > checkov_checks_list.txt
4242
echo "running tfc"

integration_tests/run_integration_tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ prepare_data () {
2222
python checkov/main.py -s --framework cloudformation -d repositories/cfngoat/ -o json --quiet > checkov_report_cfngoat_quiet.json
2323
python checkov/main.py -s -d repositories/terragoat/terraform/ --config-file integration_tests/example_config_files/config.yaml -o json > checkov_config_report_terragoat.json
2424

25-
python checkov/main.py -s -f repositories/terragoat/terraform/aws/s3.tf --bc-api-key $BC_KEY > checkov_report_s3_singlefile_api_key_terragoat.txt
26-
python checkov/main.py -s -d repositories/terragoat/terraform/azure/ --bc-api-key $BC_KEY > checkov_report_azuredir_api_key_terragoat.txt
27-
python checkov/main.py -s -d integration_tests/example_workflow_file/.github/workflows/ -o json --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_workflow_cve.json
28-
python checkov/main.py -s -d integration_tests/example_workflow_file/bitbucket/ -o json --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_bitbucket_pipelines_cve.json
25+
python checkov/main.py -s -f repositories/terragoat/terraform/aws/s3.tf --repo-id checkov/integration_test --bc-api-key $BC_KEY > checkov_report_s3_singlefile_api_key_terragoat.txt
26+
python checkov/main.py -s -d repositories/terragoat/terraform/azure/ --repo-id checkov/integration_test --bc-api-key $BC_KEY > checkov_report_azuredir_api_key_terragoat.txt
27+
python checkov/main.py -s -d integration_tests/example_workflow_file/.github/workflows/ -o json --repo-id checkov/integration_test --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_workflow_cve.json
28+
python checkov/main.py -s -d integration_tests/example_workflow_file/bitbucket/ -o json --repo-id checkov/integration_test --bc-api-key $BC_KEY --include-all-checkov-policies > checkov_report_bitbucket_pipelines_cve.json
2929
python checkov/main.py --list --bc-api-key $BC_KEY --output-bc-ids > checkov_checks_list.txt
3030
}
3131

integration_tests/test_checkov_cli_integration_report.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_terragoat_report_file_api_key(self):
2121
self.validate_report(os.path.abspath(report_path))
2222

2323
def validate_report(self, report_path, url_should_exist=True):
24-
if sys.version_info[1] == 7 and platform.system() == 'Linux':
24+
if sys.version_info[1] == 8 and platform.system() == 'Linux':
2525
platform_url_found = False
2626
with open(report_path) as f:
2727
if 'More details: https://www.bridgecrew.cloud/projects?' in f.read():
@@ -30,7 +30,7 @@ def validate_report(self, report_path, url_should_exist=True):
3030

3131
def test_workflow_report_api_key(self):
3232
report_path = os.path.join(current_dir, '..', 'checkov_report_workflow_cve.json')
33-
if sys.version_info[1] == 7 and platform.system() == 'Linux':
33+
if sys.version_info[1] == 8 and platform.system() == 'Linux':
3434
with open(report_path, encoding='utf-8') as f:
3535
reports = json.load(f)
3636
self.assertGreaterEqual(len(reports), 2,
@@ -49,7 +49,7 @@ def test_workflow_report_api_key(self):
4949

5050
def test_bitbucket_pipelines_report_api_key(self):
5151
report_path = os.path.join(current_dir, '..', 'checkov_report_bitbucket_pipelines_cve.json')
52-
if sys.version_info[1] == 7 and platform.system() == 'Linux':
52+
if sys.version_info[1] == 8 and platform.system() == 'Linux':
5353
with open(report_path, encoding='utf-8') as f:
5454
reports = json.load(f)
5555
self.assertGreaterEqual(len(reports), 2,

integration_tests/test_checkov_ext_module_cloning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
class TestCheckovExtModuleCloning(unittest.TestCase):
1111

1212
def test_private_github_modules_api_key(self):
13-
if sys.version_info[1] == 7 and platform.system() == 'Linux' and False:
13+
if sys.version_info[1] == 8 and platform.system() == 'Linux' and False:
1414
expected_private_github_path = os.path.join(ext_modules_path, "github.com", "ckv-tests")
1515
expected_private_github_modules = [os.path.join(expected_private_github_path, "terraform-aws-iam-s3-user-private"),
1616
os.path.join(expected_private_github_path, "terraform-aws-s3-bucket-private")]
1717
for m in expected_private_github_modules:
1818
assert os.path.exists(m)
1919

2020
def test_private_tfc_modules_api_key(self):
21-
if sys.version_info[1] == 7 and platform.system() == 'Linux' and False:
21+
if sys.version_info[1] == 8 and platform.system() == 'Linux' and False:
2222
expected_private_tfc_path = os.path.join(ext_modules_path, "app.terraform.io", "panw-bridgecrew")
2323
expected_private_tfc_modules = [
2424
os.path.join(expected_private_tfc_path, "iam-s3-user", "aws", "0.15.7"),

integration_tests/test_checkov_platform_only_policies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TestCheckovPlatformOnlyPolicies(unittest.TestCase):
1313

1414
def test_no_ckv_ids_api_key(self):
1515
checks_list_path = current_dir.parent / 'checkov_checks_list.txt'
16-
if sys.version_info[1] == 7 and platform.system() == 'Linux':
16+
if sys.version_info[1] == 8 and platform.system() == 'Linux':
1717
with open(checks_list_path, encoding='utf-8') as f:
1818
for i, line in enumerate(f):
1919
if i in [0, 1]:

0 commit comments

Comments
 (0)