Skip to content

Commit 9bc80d7

Browse files
committed
ci: run all test steps even when earlier ones fail
Add if: always() to each test step so a failure in one package doesn't skip the remaining test suites. The job still fails if any step fails, but now all results are visible in a single run. Made-with: Cursor
1 parent 41a88b0 commit 9bc80d7

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/ci-main.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,53 +64,66 @@ jobs:
6464
pip install -e "instrumentation-genai/opentelemetry-instrumentation-weaviate[instruments,test]"
6565
6666
- name: Run tests - opentelemetry-util-genai
67+
if: always()
6768
run: |
6869
python -m pytest util/opentelemetry-util-genai/tests/ -v --cov=opentelemetry.util.genai --cov-report=term-missing
6970
7071
- name: Run tests - opentelemetry-util-genai-emitters-splunk
72+
if: always()
7173
run: |
7274
python -m pytest util/opentelemetry-util-genai-emitters-splunk/tests/ -v
7375
7476
- name: Run tests - opentelemetry-util-genai-evals
77+
if: always()
7578
run: |
7679
python -m pytest util/opentelemetry-util-genai-evals/tests/ -v
7780
7881
- name: Run tests - opentelemetry-util-genai-evals-deepeval
82+
if: always()
7983
run: |
8084
python -m pytest util/opentelemetry-util-genai-evals-deepeval/tests/ -v
8185
8286
- name: Run tests - opentelemetry-util-genai-emitters-test
87+
if: always()
8388
run: |
8489
python -m pytest util/opentelemetry-util-genai-emitters-test/tests/ -v
8590
8691
- name: Run tests - opentelemetry-instrumentation-langchain
92+
if: always()
8793
run: |
8894
python -m pytest instrumentation-genai/opentelemetry-instrumentation-langchain/tests/ -v
8995
9096
- name: Run tests - opentelemetry-instrumentation-openai-v2
97+
if: always()
9198
run: |
9299
python -m pytest instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/ -v
93100
94101
- name: Run tests - opentelemetry-instrumentation-openai-agents-v2
102+
if: always()
95103
run: |
96104
python -m pytest instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2/tests/ -v
97105
98106
- name: Run tests - opentelemetry-instrumentation-llamaindex
107+
if: always()
99108
run: |
100109
python -m pytest instrumentation-genai/opentelemetry-instrumentation-llamaindex/tests/ -v
101110
102111
- name: Run tests - opentelemetry-instrumentation-fastmcp
112+
if: always()
103113
run: |
104114
python -m pytest instrumentation-genai/opentelemetry-instrumentation-fastmcp/tests/ -v
105115
106116
- name: Run tests - opentelemetry-instrumentation-crewai
117+
if: always()
107118
run: |
108119
python -m pytest instrumentation-genai/opentelemetry-instrumentation-crewai/tests/ -v
109120
110121
- name: Run tests - opentelemetry-instrumentation-aidefense
122+
if: always()
111123
run: |
112124
python -m pytest instrumentation-genai/opentelemetry-instrumentation-aidefense/tests/ -v
113125
114126
- name: Run tests - opentelemetry-instrumentation-weaviate
127+
if: always()
115128
run: |
116129
python -m pytest instrumentation-genai/opentelemetry-instrumentation-weaviate/tests/ -v

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/conftest.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ def fixture_meter_provider(metric_reader):
8989
@pytest.fixture(autouse=True)
9090
def environment():
9191
original_api_key = os.environ.get("OPENAI_API_KEY")
92-
original_evals = os.environ.get("OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS")
92+
original_evals = os.environ.get(
93+
"OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS"
94+
)
9395

9496
if not original_api_key:
9597
os.environ["OPENAI_API_KEY"] = "test_openai_api_key"
@@ -106,7 +108,9 @@ def environment():
106108
if original_evals is None:
107109
os.environ.pop("OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS", None)
108110
else:
109-
os.environ["OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS"] = original_evals
111+
os.environ["OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS"] = (
112+
original_evals
113+
)
110114

111115
setattr(genai_handler.get_telemetry_handler, "_default_handler", None)
112116

@@ -291,7 +295,9 @@ def deserialize(cassette_string):
291295

292296
vcr_module.VCR().register_serializer("yaml", PrettyPrintJSONBody)
293297

294-
except ModuleNotFoundError:
298+
except (
299+
ModuleNotFoundError
300+
): # pragma: no cover - provide stub when plugin missing
295301

296302
@pytest.fixture(name="vcr", scope="module")
297303
def _noop_vcr_fixture():

0 commit comments

Comments
 (0)