Skip to content

Commit 83c95f9

Browse files
committed
Fixes from Copilot review
1 parent fa7b85c commit 83c95f9

6 files changed

Lines changed: 22 additions & 4 deletions

File tree

.github/actions/acceptance-tests-e2e/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ runs:
1010
using: "composite"
1111

1212
steps:
13+
- name: "Set PR NUMBER"
14+
id: set_pr_number
15+
shell: bash
16+
run: |
17+
env="${{ inputs.targetEnvironment }}"
18+
if [[ "$env" == main ]]; then
19+
echo "pr_number=" >> $GITHUB_OUTPUT
20+
elif [[ "$env" == pr* ]]; then
21+
echo "pr_number=${env#pr}" >> $GITHUB_OUTPUT
22+
else
23+
echo "pr_number=$env" >> $GITHUB_OUTPUT
24+
fi
1325
1426
- name: Determine if proxy has been deployed
1527
id: check_proxy_deployed

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ trigger_response=$(curl -s -L \
295295

296296
if [[ $? -ne 0 ]]; then
297297
echo "[ERROR] Failed to trigger workflow. Response: $trigger_response"
298+
exit 1
298299
fi
299300

300301
echo "[INFO] Workflow trigger request sent successfully, waiting for completion..."

.github/workflows/stage-3-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
with:
208208
version: "${{ inputs.version }}"
209209
environment: ${{ needs.pr-create-dynamic-environment.outputs.environment_name }}
210-
apimEnv: "${{ inputs.pr_number != '' && 'internal-dev' || 'internal-dev-pr' }}"
210+
apimEnv: "${{ inputs.pr_number == '' && 'internal-dev' || 'internal-dev-pr' }}"
211211
runId: "${{ github.run_id }}"
212212
buildSandbox: true
213213
releaseVersion: ${{ github.head_ref || github.ref_name }}

tests/e2e-tests/api/headers/test_x_request_id.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
METHODS = ["get", "post"]
88

9-
109
@pytest.mark.test
1110
@pytest.mark.devtest
1211
@pytest.mark.inttest
@@ -19,8 +18,10 @@ def test_header_letters_endpoint(
1918
endpoints,
2019
authentication_secret
2120
):
21+
auth_header = {"apikey": authentication_secret.value} if authentication_secret.auth_type == "apikey" \
22+
else {"Authorization": authentication_secret.value}
2223
resp = getattr(requests, method)(f"{url}/{endpoints}", headers={
23-
"Authorization": authentication_secret.value,
24+
**auth_header,
2425
"X-Request-ID": None
2526
})
2627

@@ -35,8 +36,10 @@ def test_header_mi_endpoint(
3536
url,
3637
authentication_secret
3738
):
39+
auth_header = {"apikey": authentication_secret.value} if authentication_secret.auth_type == "apikey" \
40+
else {"Authorization": authentication_secret.value}
3841
resp = getattr(requests, "post")(f"{url}/{MI_ENDPOINT}", headers={
39-
"Authorization": authentication_secret.value,
42+
**auth_header,
4043
"X-Request-ID": ""
4144
})
4245

tests/e2e-tests/lib/authentication.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def generate_and_test_new_token(self, api_key, private_key, url, kid, test_url):
9898
return new_token
9999

100100
print("Could not generate token")
101+
raise RuntimeError("Could not generate token")
101102

102103
def generate_new_token(self, api_key, private_key, url, kid):
103104
pk_pem = None

tests/e2e-tests/lib/generators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Generators:
2+
@staticmethod
23
def generate_valid_create_message_body(environment="sandbox"):
34
return {
45
"data": {

0 commit comments

Comments
 (0)