Skip to content

Commit 47ceadf

Browse files
committed
test env var fix
1 parent 196c623 commit 47ceadf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_start.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from unittest.mock import call, patch, mock_open, Mock
55
from ec2_gha.start import StartAWS
66
from botocore.exceptions import WaiterError, ClientError
7+
import os
78

89

910
@pytest.fixture(scope="function")
@@ -114,6 +115,12 @@ def complete_params():
114115
yield params
115116

116117

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+
})
117124
def test_build_aws_params(complete_params):
118125
user_data_params = {
119126
"token": "test",
@@ -148,6 +155,9 @@ def test_build_aws_params(complete_params):
148155
"Tags": [
149156
{"Key": "Name", "Value": "test"},
150157
{"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"},
151161
],
152162
}
153163
]

0 commit comments

Comments
 (0)