|
4 | 4 | from unittest.mock import call, patch, mock_open, Mock |
5 | 5 | from ec2_gha.start import StartAWS |
6 | 6 | from botocore.exceptions import WaiterError, ClientError |
| 7 | +import os |
7 | 8 |
|
8 | 9 |
|
9 | 10 | @pytest.fixture(scope="function") |
@@ -114,6 +115,12 @@ def complete_params(): |
114 | 115 | yield params |
115 | 116 |
|
116 | 117 |
|
| 118 | +@patch.dict('os.environ', { |
| 119 | + 'GITHUB_REPOSITORY': 'Open-Athena/ec2-gha', |
| 120 | + 'GITHUB_WORKFLOW': 'CI', |
| 121 | + 'GITHUB_SERVER_URL': 'https://github.com', |
| 122 | + 'GITHUB_RUN_ID': '16725250800' |
| 123 | +}) |
117 | 124 | def test_build_aws_params(complete_params): |
118 | 125 | user_data_params = { |
119 | 126 | "token": "test", |
@@ -148,6 +155,9 @@ def test_build_aws_params(complete_params): |
148 | 155 | "Tags": [ |
149 | 156 | {"Key": "Name", "Value": "test"}, |
150 | 157 | {"Key": "Owner", "Value": "test"}, |
| 158 | + {"Key": "repository", "Value": "Open-Athena/ec2-gha"}, |
| 159 | + {"Key": "workflow", "Value": "CI"}, |
| 160 | + {"Key": "gha_url", "Value": "https://github.com/Open-Athena/ec2-gha/actions/runs/16725250800"}, |
151 | 161 | ], |
152 | 162 | } |
153 | 163 | ] |
|
0 commit comments