Skip to content

Commit eec9773

Browse files
author
Matt Tolstolytsky
committed
test
1 parent b22b506 commit eec9773

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.github/workflows/ci-daily-checks.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ jobs:
4444
GW3_SECRET_KEY=${GW3_SECRET_KEY}
4545
PINATA_JWT=${PINATA_JWT}
4646
EOF
47+
48+
echo "OPSGENIE_API_URL: ${OPSGENIE_API_URL}"
4749
48-
docker run --env-file .env --rm lidofinance/oracle:dev check
50+
docker build -t lido-oracle-ci . && docker run --env-file .env --rm lido-oracle-ci check

src/modules/checks/suites/conftest.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ def pytest_runtest_logreport(report) -> None:
138138
print(report.head_line, end="")
139139
if report.when == 'call':
140140
print(report.head_line, end="")
141+
print(f"Test {report.nodeid} failed: {report.failed}")
141142

142143
if report.failed:
143-
check_name = report.nodeid
144-
reason = str(report.longrepr) if report.longrepr else 'Unknown failure reason'
144+
print("alert send...")
145+
check_name = report.nodeid[:110]
146+
reason = str(report.longrepr)[:10000] if report.longrepr else 'Unknown failure reason'
145147
opsgenie_api.send_opsgenie_alert({
146-
'message': f'Oracle check failed: {check_name}',
148+
'message': f'Oracle check: {check_name}',
147149
'description': f'Reason: {reason}',
148150
'priority': opsgenie_api.AlertPriority.MINOR.value,
149151
'tags': ['oracle_checks', 'oracle'],

src/modules/checks/suites/ipfs.py

+3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ def check_ipfs_provider(provider: IPFSProvider, content: str):
4545
except IPFSError as e:
4646
raise AssertionError(f"Provider {provider.__class__.__name__} is not working") from e
4747

48+
raise IPFSError(f"Test")
49+
4850

4951
def check_csm_requires_ipfs_provider():
52+
pytest.fail("Test 2")
5053
if not variables.CSM_MODULE_ADDRESS:
5154
pytest.skip("IPFS provider is not requirement for non-CSM oracle")
5255

src/utils/api/opsgenie.py

+6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def send_opsgenie_alert(
3333
https://docs.opsgenie.com/docs/alert-api#create-alert
3434
3535
"""
36+
print(self.api_url)
3637
if not self.api_key or not self.api_url:
38+
print('OpsGenie not configured, ignore')
3739
self.logger.info({'msg': 'OpsGenie not configured, ignore.'})
3840
return
3941

@@ -50,7 +52,11 @@ def send_opsgenie_alert(
5052
timeout=10,
5153
)
5254
response.raise_for_status()
55+
print(payload)
56+
print(response.json())
57+
print(response.status_code)
5358
except requests.RequestException as e:
59+
print(f'OpsGenie API request failed: {e}')
5460
self.logger.warning(
5561
{'msg': f'OpsGenie is not available: {e}.'}
5662
)

0 commit comments

Comments
 (0)