Skip to content

Commit e040fa0

Browse files
Add CBCFlow integration tests and update apply_via_plugin to use current ledger (#116)
1 parent 30bac0a commit e040fa0

File tree

3 files changed

+609
-1
lines changed

3 files changed

+609
-1
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CBCFlow Integration Tests
2+
3+
# These tests check the integration between asimov and cbcflow.
4+
# They are allowed to fail (continue-on-error: true) because:
5+
# - cbcflow is an optional external dependency
6+
# - some failures reveal known issues to be fixed incrementally
7+
#
8+
# Run on the same branches as the main test suite so failures are visible.
9+
10+
on:
11+
push:
12+
branches: [ master, v*-release, v*-preview ]
13+
tags:
14+
- 'v[0-9]+.[0-9]+.[0-9]+'
15+
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
16+
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
17+
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
18+
pull_request:
19+
branches: [ master, v*-release, v*-preview ]
20+
21+
jobs:
22+
cbcflow-integration:
23+
name: CBCFlow integration (Python 3.11)
24+
runs-on: ubuntu-latest
25+
continue-on-error: true
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Set up Python 3.11
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.11"
36+
37+
- name: Install asimov
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install .
41+
pip install ".[bilby]"
42+
43+
- name: Install cbcflow
44+
run: pip install cbcflow
45+
46+
- name: Set up git identity
47+
run: |
48+
git config --global user.email "test@asimov.test"
49+
git config --global user.name "Asimov Test"
50+
git config --global init.defaultBranch main
51+
52+
- name: Run CBCFlow integration tests
53+
run: python -m unittest tests.test_cbcflow_integration -v

asimov/cli/application.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,10 @@ def apply_page(file, event=None, ledger=None, update_page=False):
405405

406406
def apply_via_plugin(event, hookname, **kwargs):
407407
discovered_hooks = entry_points(group="asimov.hooks.applicator")
408+
current_ledger = get_ledger()
408409
for hook in discovered_hooks:
409410
if hook.name in hookname:
410-
hook.load()(ledger).run(event)
411+
hook.load()(current_ledger).run(event)
411412
click.echo(click.style("●", fg="green") + f"{event} has been applied.")
412413

413414
break

0 commit comments

Comments
 (0)