Skip to content

Commit 62b8098

Browse files
author
Trong Nhan Mai
committed
chore: add integration test cases
Signed-off-by: Trong Nhan Mai <[email protected]>
1 parent af4173e commit 62b8098

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

scripts/dev_scripts/integration_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ run_macaron_clean $ANALYZE -purl pkg:maven/io.github.behnazh-w.demo/example-mave
398398
check_or_update_expected_output $COMPARE_DEPS $DEP_RESULT $DEP_EXPECTED || log_fail
399399

400400
python3 ./tests/integration/run.py run \
401+
--exclude-tag token_file_clean_up \
401402
./tests/integration/cases/... || log_fail
402403

403404
# Important: This should be at the end of the file

tests/integration/cases/apache_maven_purl_repo_path/test.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ steps:
2121
- -d
2222
- 3fc399318edef0d5ba593723a24fff64291d6f9b
2323
- --skip-deps
24+
# This to check if run_macaron.sh cleans up the token file after the test case runs for the docker image.
25+
- name: Check the token file doesn't exist.
26+
kind: shell
27+
options:
28+
cmd: ls .macaron_env_file
29+
expect_fail: true
2430
- name: Run macaron verify-policy to verify passed/failed checks
2531
kind: verify
2632
options:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
3+
4+
description: |
5+
Running run_macaron.sh on scenarios where the docker image is not available
6+
7+
tags:
8+
- docker
9+
- token_file_clean_up
10+
11+
steps:
12+
- name: Run run_macaron.sh.py with invalid docker image tag and DOCKER_PULL set to missing.
13+
kind: analyze
14+
env:
15+
MACARON_IMAGE_TAG: this_is_not_a_real_tag
16+
DOCKER_PULL: missing
17+
options:
18+
command_args:
19+
- --version
20+
expect_fail: true
21+
- name: Check the token file doesn't exist.
22+
kind: shell
23+
options:
24+
cmd: ls .macaron_env_file
25+
expect_fail: true
26+
- name: Run run_macaron.sh.py with invalid docker image tag and DOCKER_PULL set to always.
27+
kind: analyze
28+
env:
29+
MACARON_IMAGE_TAG: this_is_not_a_real_tag
30+
DOCKER_PULL: always
31+
options:
32+
command_args:
33+
- --version
34+
expect_fail: true
35+
- name: Check the token file doesn't exist.
36+
kind: shell
37+
options:
38+
cmd: ls .macaron_env_file
39+
expect_fail: true
40+
- name: Run run_macaron.sh.py with invalid docker image tag and DOCKER_PULL set to never.
41+
kind: analyze
42+
env:
43+
MACARON_IMAGE_TAG: this_is_not_a_real_tag
44+
DOCKER_PULL: never
45+
options:
46+
command_args:
47+
- --version
48+
expect_fail: true
49+
- name: Check the token file doesn't exist.
50+
kind: shell
51+
options:
52+
cmd: ls .macaron_env_file
53+
expect_fail: true
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
3+
4+
description: |
5+
Making sure run_macaron.sh clean up the token file when it exits because DOCKER_PULL is set to an invalid value.
6+
7+
tags:
8+
- docker
9+
- token_file_clean_up
10+
11+
steps:
12+
- name: Run run_macaron.sh.py with DOCKER_PULL set to invalid value.
13+
kind: analyze
14+
env:
15+
DOCKER_PULL: invalid_value
16+
options:
17+
command_args:
18+
- --version
19+
expect_fail: true
20+
- name: Check the token file doesn't exist.
21+
kind: shell
22+
options:
23+
cmd: ls .macaron_env_file
24+
expect_fail: true

0 commit comments

Comments
 (0)