Skip to content

Commit 6ef17f1

Browse files
mpk-droidclaude
andcommitted
fix: correct upload-artifact SHA and write .env for CI
- Fix invalid commit SHA for actions/upload-artifact - Write .env file in test fixture so make deploy can source it (Makefile does `source .env` without error suppression) - Clean up .env in fixture finalizer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 319c000 commit 6ef17f1

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/agent-deployment-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Upload test results
8080
if: always()
81-
uses: actions/upload-artifact@ea165f8d65b6db9b8a1f7f0bc5b6a0bce0152916 # v4.6.2
81+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
8282
with:
8383
name: ${{ matrix.agent.name }}-results
8484
path: ${{ matrix.agent.dir }}/results.xml

agents/langgraph/react_agent/tests/integration/test_deployment.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import logging
4+
import os
45

56
import pytest
67

@@ -22,19 +23,31 @@ def agent_dir(repo_root):
2223
return repo_root / "agents" / "langgraph" / "react_agent"
2324

2425

26+
def _write_env_file(agent_dir, container_image):
27+
"""Write a .env file so Makefile targets can source it."""
28+
env_path = agent_dir / ".env"
29+
env_path.write_text(
30+
f"API_KEY={os.environ.get('API_KEY', 'not-needed')}\n"
31+
f"BASE_URL={os.environ['BASE_URL']}\n"
32+
f"MODEL_ID={os.environ['MODEL_ID']}\n"
33+
f"CONTAINER_IMAGE={container_image}\n"
34+
)
35+
return env_path
36+
37+
2538
@pytest.fixture(scope="module")
2639
def deployed_agent(cluster_auth, agent_dir):
2740
namespace = cluster_auth["namespace"]
2841
container_image = f"{INTERNAL_REGISTRY}/{namespace}/{AGENT_NAME}:latest"
29-
deploy_env = {"CONTAINER_IMAGE": container_image}
42+
env_path = _write_env_file(agent_dir, container_image)
3043

3144
deployed = False
3245
try:
3346
logger.info("Building image on cluster via build-openshift...")
3447
run_make("build-openshift", cwd=agent_dir, timeout=600)
3548

3649
logger.info("Deploying to cluster...")
37-
run_make("deploy", cwd=agent_dir, timeout=300, env=deploy_env)
50+
run_make("deploy", cwd=agent_dir, timeout=300)
3851
deployed = True
3952

4053
route_url = get_route(AGENT_NAME)
@@ -52,6 +65,7 @@ def deployed_agent(cluster_auth, agent_dir):
5265
run_make("undeploy", cwd=agent_dir, timeout=120)
5366
except MakeTargetError:
5467
logger.warning("Cleanup failed — manual undeploy may be needed", exc_info=True)
68+
env_path.unlink(missing_ok=True)
5569

5670

5771
@pytest.mark.integration

0 commit comments

Comments
 (0)