Skip to content

Commit 04b44ab

Browse files
authored
Merge branch 'master' into fix-feerate-tolerance
2 parents b473b0d + 611e262 commit 04b44ab

File tree

191 files changed

+5949
-4676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+5949
-4676
lines changed

.github/scripts/sync-rpc-cmds.py

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
# readme url
99
URL = "https://api.readme.com/v2/branches/stable"
10-
# category id for API reference
11-
CATEGORY_ID = "685ce4df1df887006ff221c5"
1210
CATEGORY_SLUG = "JSON-RPC API Reference"
1311

1412

@@ -26,39 +24,76 @@ def getListOfRPCDocs(headers):
2624
return []
2725

2826

27+
def check_renderable(response, action, title):
28+
try:
29+
data = response.json()
30+
except Exception:
31+
print("Non-JSON response:")
32+
print(response.text)
33+
return False
34+
35+
renderable = data.get("renderable")
36+
if renderable is None:
37+
# Some endpoints don’t include renderable (e.g. DELETE)
38+
return True
39+
40+
if not renderable.get("status", False):
41+
print(f"\n❌ RENDER FAILED for {action.value.upper()} '{title}'")
42+
print("Error :", renderable.get("error"))
43+
print("Message:", renderable.get("message"))
44+
return False
45+
46+
return True
47+
48+
2949
def publishDoc(action, title, body, order, headers):
3050
payload = {
3151
"title": title,
3252
"type": "basic",
33-
"body": body,
53+
"content": {
54+
"body": body,
55+
},
3456
"category": {
35-
"id": CATEGORY_ID
57+
"uri": f"/branches/1/categories/reference/{CATEGORY_SLUG}"
3658
},
3759
"hidden": False,
3860
"order": order,
3961
}
62+
4063
if action == Action.ADD:
41-
# create doc
42-
payload['slug'] = title
64+
payload["slug"] = title
4365
response = requests.post(URL + "/reference", json=payload, headers=headers)
4466
if response.status_code != 201:
67+
print("❌ HTTP ERROR:", response.status_code)
4568
print(response.text)
46-
else:
47-
print("Created ", title)
69+
return
70+
71+
if not check_renderable(response, action, title):
72+
raise RuntimeError(f"Renderable check failed for {title}")
73+
74+
print("✅ Created", title)
75+
4876
elif action == Action.UPDATE:
49-
# update doc
5077
response = requests.patch(f"{URL}/reference/{title}", json=payload, headers=headers)
5178
if response.status_code != 200:
79+
print("❌ HTTP ERROR:", response.status_code)
5280
print(response.text)
53-
else:
54-
print("Updated ", title)
81+
return
82+
83+
if not check_renderable(response, action, title):
84+
raise RuntimeError(f"Renderable check failed for {title}")
85+
86+
print("✅ Updated", title)
87+
5588
elif action == Action.DELETE:
56-
# delete doc
5789
response = requests.delete(f"{URL}/reference/{title}", headers=headers)
90+
5891
if response.status_code != 204:
92+
print("❌ DELETE FAILED:", title)
5993
print(response.text)
6094
else:
61-
print("Deleted ", title)
95+
print("🗑️ Deleted", title)
96+
6297
else:
6398
print("Invalid action")
6499

.github/workflows/ci.yaml

Lines changed: 84 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
RUST_PROFILE: release
1717
SLOW_MACHINE: 1
1818
CI_SERVER_URL: "http://35.239.136.52:3170"
19-
GLOBAL_PYTEST_OPTS: "--reruns=10 -vvv"
19+
PYTEST_OPTS_BASE: "--reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10"
2020

2121
jobs:
2222
prebuild:
@@ -90,9 +90,16 @@ jobs:
9090
- name: Check source
9191
env:
9292
VALGRIND: 0
93-
PYTEST_OPTS: --timeout=1200 --durations=10
93+
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
9494
run: |
9595
uv run make check-source BASE_REF="origin/${{ github.base_ref }}"
96+
- name: Upload test results
97+
if: always()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: pytest-results-prebuild
101+
path: report.xml
102+
if-no-files-found: ignore
96103
- name: Check Generated Files have been updated
97104
run: uv run make check-gen-updated
98105
- name: Check docs
@@ -311,18 +318,26 @@ jobs:
311318
LIGHTNINGD_POSTGRES_NO_VACUUM: 1
312319
VALGRIND: ${{ matrix.VALGRIND }}
313320
PREV_LIGHTNINGD: /tmp/old-cln/usr/bin/lightningd
321+
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
314322
run: |
315323
env
316324
cat config.vars
317-
uv run eatmydata pytest tests/test_downgrade.py ${GLOBAL_PYTEST_OPTS} -n ${PYTEST_PAR} ${PYTEST_OPTS}
325+
uv run eatmydata pytest tests/test_downgrade.py -n ${PYTEST_PAR} ${PYTEST_OPTS}
326+
- name: Upload test results
327+
if: always()
328+
uses: actions/upload-artifact@v4
329+
with:
330+
name: pytest-results-check-downgrade-${{ matrix.TEST_DB_PROVIDER }}-${{ matrix.TEST_NETWORK }}
331+
path: report.xml
332+
if-no-files-found: ignore
318333

319334
integration:
320335
name: Test CLN ${{ matrix.name }}
321336
runs-on: ubuntu-22.04
322337
timeout-minutes: 120
323338
env:
324339
RUST_PROFILE: release # Has to match the one in the compile step
325-
PYTEST_OPTS: --timeout=1200 --durations=10
340+
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10
326341
needs:
327342
- compile
328343
strategy:
@@ -422,7 +437,14 @@ jobs:
422437
run: |
423438
env
424439
cat config.vars
425-
VALGRIND=0 uv run eatmydata pytest tests/ -vvv ${GLOBAL_PYTEST_OPTS} -n ${PYTEST_PAR} ${PYTEST_OPTS}
440+
VALGRIND=0 uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}
441+
- name: Upload test results
442+
if: always()
443+
uses: actions/upload-artifact@v4
444+
with:
445+
name: pytest-results-integration-${{ matrix.name }}
446+
path: report.xml
447+
if-no-files-found: ignore
426448

427449
integration-valgrind:
428450
name: Valgrind Test CLN ${{ matrix.name }}
@@ -431,32 +453,42 @@ jobs:
431453
env:
432454
RUST_PROFILE: release # Has to match the one in the compile step
433455
CFG: compile-gcc
434-
PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800 --durations=10 --reruns=10
456+
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42
435457
needs:
436458
- compile
437459
strategy:
438460
fail-fast: false
439461
matrix:
440462
include:
441463
- NAME: Valgrind (01/10)
464+
GROUP: 1
442465
PYTEST_OPTS: --test-group=1 --test-group-count=10
443466
- NAME: Valgrind (02/10)
467+
GROUP: 2
444468
PYTEST_OPTS: --test-group=2 --test-group-count=10
445469
- NAME: Valgrind (03/10)
470+
GROUP: 3
446471
PYTEST_OPTS: --test-group=3 --test-group-count=10
447472
- NAME: Valgrind (04/10)
473+
GROUP: 4
448474
PYTEST_OPTS: --test-group=4 --test-group-count=10
449475
- NAME: Valgrind (05/10)
476+
GROUP: 5
450477
PYTEST_OPTS: --test-group=5 --test-group-count=10
451478
- NAME: Valgrind (06/10)
479+
GROUP: 6
452480
PYTEST_OPTS: --test-group=6 --test-group-count=10
453481
- NAME: Valgrind (07/10)
482+
GROUP: 7
454483
PYTEST_OPTS: --test-group=7 --test-group-count=10
455484
- NAME: Valgrind (08/10)
485+
GROUP: 8
456486
PYTEST_OPTS: --test-group=8 --test-group-count=10
457487
- NAME: Valgrind (09/10)
488+
GROUP: 9
458489
PYTEST_OPTS: --test-group=9 --test-group-count=10
459490
- NAME: Valgrind (10/10)
491+
GROUP: 10
460492
PYTEST_OPTS: --test-group=10 --test-group-count=10
461493
steps:
462494
- name: Checkout
@@ -492,7 +524,14 @@ jobs:
492524
SLOW_MACHINE: 1
493525
TEST_DEBUG: 1
494526
run: |
495-
VALGRIND=1 uv run eatmydata pytest tests/ ${GLOBAL_PYTEST_OPTS} -n 3 ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}
527+
VALGRIND=1 uv run eatmydata pytest tests/ -n 3 ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}
528+
- name: Upload test results
529+
if: always()
530+
uses: actions/upload-artifact@v4
531+
with:
532+
name: pytest-results-integration-valgrind-${{ matrix.GROUP }}
533+
path: report.xml
534+
if-no-files-found: ignore
496535

497536
integration-sanitizers:
498537
name: Sanitizers Test CLN
@@ -502,36 +541,48 @@ jobs:
502541
RUST_PROFILE: release
503542
SLOW_MACHINE: 1
504543
TEST_DEBUG: 1
505-
PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800 --durations=10 --reruns=10
544+
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42
506545
needs:
507546
- compile
508547
strategy:
509548
fail-fast: false
510549
matrix:
511550
include:
512551
- NAME: ASan/UBSan (01/12)
552+
GROUP: 1
513553
PYTEST_OPTS: --test-group=1 --test-group-count=12
514554
- NAME: ASan/UBSan (02/12)
555+
GROUP: 2
515556
PYTEST_OPTS: --test-group=2 --test-group-count=12 -n 1
516557
- NAME: ASan/UBSan (03/12)
558+
GROUP: 3
517559
PYTEST_OPTS: --test-group=3 --test-group-count=12
518560
- NAME: ASan/UBSan (04/12)
561+
GROUP: 4
519562
PYTEST_OPTS: --test-group=4 --test-group-count=12
520563
- NAME: ASan/UBSan (05/12)
564+
GROUP: 5
521565
PYTEST_OPTS: --test-group=5 --test-group-count=12
522566
- NAME: ASan/UBSan (06/12)
567+
GROUP: 6
523568
PYTEST_OPTS: --test-group=6 --test-group-count=12
524569
- NAME: ASan/UBSan (07/12)
570+
GROUP: 7
525571
PYTEST_OPTS: --test-group=7 --test-group-count=12
526572
- NAME: ASan/UBSan (08/12)
573+
GROUP: 8
527574
PYTEST_OPTS: --test-group=8 --test-group-count=12
528575
- NAME: ASan/UBSan (09/12)
576+
GROUP: 9
529577
PYTEST_OPTS: --test-group=9 --test-group-count=12
530578
- NAME: ASan/UBSan (10/12)
579+
GROUP: 10
531580
PYTEST_OPTS: --test-group=10 --test-group-count=12
532581
- NAME: ASan/UBSan (11/12)
582+
GROUP: 11
533583
PYTEST_OPTS: --test-group=11 --test-group-count=12
534584
- NAME: ASan/UBSan (12/12)
585+
GROUP: 12
535586
PYTEST_OPTS: --test-group=12 --test-group-count=12
536587
steps:
537588
- name: Checkout
@@ -562,7 +613,14 @@ jobs:
562613

563614
- name: Test
564615
run: |
565-
uv run eatmydata pytest tests/ ${GLOBAL_PYTEST_OPTS} -n 2 ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}
616+
uv run eatmydata pytest tests/ -n 2 ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}
617+
- name: Upload test results
618+
if: always()
619+
uses: actions/upload-artifact@v4
620+
with:
621+
name: pytest-results-integration-sanitizers-${{ matrix.GROUP }}
622+
path: report.xml
623+
if-no-files-found: ignore
566624

567625
update-docs-examples:
568626
name: Update examples in doc schemas (disabled temporarily!)
@@ -574,7 +632,7 @@ jobs:
574632
env:
575633
VALGRIND: 0
576634
GENERATE_EXAMPLES: 1
577-
PYTEST_OPTS: --timeout=1200 --durations=10
635+
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10
578636
TEST_NETWORK: regtest
579637
needs:
580638
- compile
@@ -606,14 +664,21 @@ jobs:
606664
- name: Test
607665
run: |
608666
uv run eatmydata make -j $(nproc) check-doc-examples
667+
- name: Upload test results
668+
if: always()
669+
uses: actions/upload-artifact@v4
670+
with:
671+
name: pytest-results-update-docs-examples
672+
path: report.xml
673+
if-no-files-found: ignore
609674

610675
min-btc-support:
611676
name: Test minimum supported BTC v${{ matrix.MIN_BTC_VERSION }} with ${{ matrix.NAME }}
612677
runs-on: ubuntu-22.04
613678
timeout-minutes: 120
614679
env:
615680
RUST_PROFILE: release # Has to match the one in the compile step
616-
PYTEST_OPTS: --timeout=1200 --durations=10
681+
PYTEST_OPTS: --reruns=10 -vvv --junit-xml=report.xml --timeout=1800 --durations=10
617682
needs:
618683
- compile
619684
strategy:
@@ -679,7 +744,14 @@ jobs:
679744
run: |
680745
env
681746
cat config.vars
682-
VALGRIND=0 uv run eatmydata pytest tests/ ${GLOBAL_PYTEST_OPTS} -n ${PYTEST_PAR} ${PYTEST_OPTS}
747+
VALGRIND=0 uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}
748+
- name: Upload test results
749+
if: always()
750+
uses: actions/upload-artifact@v4
751+
with:
752+
name: pytest-results-min-btc-support-${{ matrix.NAME }}
753+
path: report.xml
754+
if-no-files-found: ignore
683755

684756

685757
gather:

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)