-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_pipeline.py
More file actions
40 lines (30 loc) · 918 Bytes
/
Copy pathtest_pipeline.py
File metadata and controls
40 lines (30 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
"""Test script for pipeline runner"""
import subprocess
import sys
def test_successful_pipeline():
"""Test pipeline with all successful jobs"""
print("\n" + "=" * 60)
print("TEST 1: Successful Pipeline")
print("=" * 60)
result = subprocess.run(
["python3", "pipeline_runner.py", "pipeline_config.yaml"],
text=True
)
return result.returncode == 0
def test_failed_pipeline():
"""Test pipeline with job failure"""
print("\n" + "=" * 60)
print("TEST 2: Pipeline with Failure")
print("=" * 60)
result = subprocess.run(
["python3", "pipeline_runner.py", "pipeline_config_fail.yaml"],
text=True
)
return result.returncode == 0
if __name__ == "__main__":
success_1 = test_successful_pipeline()
success_2 = test_failed_pipeline()
if success_1 and success_2:
sys.exit(0)
sys.exit(1)