Add focused Narratio integration coverage

This commit is contained in:
2026-09-09 21:49:53 +00:00
parent 3be78d8108
commit 0e8ad9f296
4 changed files with 135 additions and 5 deletions

View File

@@ -142,10 +142,15 @@ does not install the downstream applications, campaign content, or suite policy.
## Validation ## Validation
The repository-local integration suite installs its pinned collection, runs The repository-local integration suite installs its pinned collection and runs
syntax checking and production-profile lint, validates a baseline managed syntax checking and production-profile lint. It validates a baseline managed
pipeline through Narratio as its application account, and requires immediate pipeline through Narratio as its application account and requires immediate
clean repeated convergence. It restores the baseline deployment during cleanup. clean repeated convergence. It explicitly selects `v2.0.0` and checks native
version output, then combines missing-binary recovery with a caller-supplied Go
executable while dependency management is disabled. A representative pipeline
checks null omission, falsey values, and caller-composed native collections
before native validation and a clean repeat. The suite restores the baseline
deployment during cleanup.
```sh ```sh
tests/integration tests/integration

View File

@@ -12,6 +12,8 @@ export ANSIBLE_ROLES_PATH="$(dirname "$repository_root")"
inventory="$repository_root/tests/inventory" inventory="$repository_root/tests/inventory"
converge="$repository_root/tests/converge.yml" converge="$repository_root/tests/converge.yml"
verify_baseline="$repository_root/tests/verify-baseline.yml" verify_baseline="$repository_root/tests/verify-baseline.yml"
representative="$repository_root/tests/representative.yml"
verify_config="$repository_root/tests/verify-config.yml"
ansible_playbook="$workspace_venv/bin/ansible-playbook" ansible_playbook="$workspace_venv/bin/ansible-playbook"
baseline_args=(-e 'narratio_whisperx_transcribe_url=http://127.0.0.1:8000/transcribe') baseline_args=(-e 'narratio_whisperx_transcribe_url=http://127.0.0.1:8000/transcribe')
@@ -39,7 +41,9 @@ cd "$repository_root"
-r collections/requirements.yml \ -r collections/requirements.yml \
-p "$ANSIBLE_COLLECTIONS_PATH" -p "$ANSIBLE_COLLECTIONS_PATH"
"$ansible_playbook" -i "$inventory" --syntax-check "$converge" "$ansible_playbook" -i "$inventory" --syntax-check "$converge"
"$workspace_venv/bin/ansible-lint" "$converge" "$verify_baseline" "$ansible_playbook" -i "$inventory" --syntax-check "$representative"
"$workspace_venv/bin/ansible-lint" "$converge" "$representative" \
"$verify_baseline" "$verify_config"
baseline_log="$test_tmp/baseline.log" baseline_log="$test_tmp/baseline.log"
run_converge "$baseline_log" "${baseline_args[@]}" run_converge "$baseline_log" "${baseline_args[@]}"
@@ -47,3 +51,36 @@ run_converge "$baseline_log" "${baseline_args[@]}"
baseline_repeat_log="$test_tmp/baseline-repeat.log" baseline_repeat_log="$test_tmp/baseline-repeat.log"
run_converge "$baseline_repeat_log" "${baseline_args[@]}" run_converge "$baseline_repeat_log" "${baseline_args[@]}"
require_clean_recap "$baseline_repeat_log" require_clean_recap "$baseline_repeat_log"
selected_version_log="$test_tmp/selected-version.log"
run_converge "$selected_version_log" "${baseline_args[@]}" -e 'narratio_version=v2.0.0'
/usr/local/bin/narratio version | grep -Fx 'narratio v2.0.0'
custom_go_binary="$test_tmp/go"
custom_go_invocations="$test_tmp/go-invocations.log"
printf '%s\n' \
'#!/usr/bin/env bash' \
'set -euo pipefail' \
"printf '%s\\n' \"\$*\" >> $custom_go_invocations" \
'exec /snap/bin/go "$@"' > "$custom_go_binary"
chmod 0755 "$custom_go_binary"
sudo rm -f -- /usr/local/bin/narratio
recovery_log="$test_tmp/recovery.log"
run_converge "$recovery_log" "${baseline_args[@]}" \
-e '{"narratio_manage_build_dependencies": false}' \
-e "narratio_go_binary=$custom_go_binary"
grep -q . "$custom_go_invocations"
/usr/local/bin/narratio version | grep -Fx 'narratio v2.0.0'
"$ansible_playbook" -i "$inventory" "$verify_baseline"
recovery_repeat_log="$test_tmp/recovery-repeat.log"
run_converge "$recovery_repeat_log" "${baseline_args[@]}" \
-e '{"narratio_manage_build_dependencies": false}' \
-e "narratio_go_binary=$custom_go_binary"
require_clean_recap "$recovery_repeat_log"
representative_log="$test_tmp/representative.log"
"$ansible_playbook" -i "$inventory" "$representative" | tee "$representative_log"
"$ansible_playbook" -i "$inventory" "$verify_config"
representative_repeat_log="$test_tmp/representative-repeat.log"
"$ansible_playbook" -i "$inventory" "$representative" | tee "$representative_repeat_log"
require_clean_recap "$representative_repeat_log"

37
tests/representative.yml Normal file
View File

@@ -0,0 +1,37 @@
---
- name: Converge representative Narratio configuration
hosts: localhost
gather_facts: true
vars:
narratio_whisperx_transcribe_url: http://127.0.0.1:8000/transcribe
narratio_publish_primary_outputs:
- source: narratio.transcript.final_markdown
dest: transcripts/final.md
required: false
narratio_publish_additional_outputs: []
narratio_scriptorium_base_artifacts:
disabled_fixture:
enabled: false
narratio_scriptorium_additional_artifacts: {}
narratio_workspace_cleanup_after_publish: false
narratio_campaigns_default_campaign_id: ""
narratio_storage_backend: null
narratio_spool_delete_audio_after_publish: false
narratio_cache_s3_audio: false
narratio_publish_enabled: false
narratio_publish_outputs: >-
{{ narratio_publish_primary_outputs + narratio_publish_additional_outputs }}
narratio_whisperx_retries: 0
narratio_seriatim_coalesce_gap: 0.0
narratio_seriatim_report: false
narratio_audita_modules: []
narratio_audita_report: false
narratio_normalize_output_path: null
narratio_trim_enabled: false
narratio_trim_bounds_render_debug: false
narratio_render_enabled: false
narratio_render_include_metadata: false
narratio_scriptorium_artifacts: >-
{{ narratio_scriptorium_base_artifacts | combine(narratio_scriptorium_additional_artifacts) }}
roles:
- role: ansible-role-narratio

51
tests/verify-config.yml Normal file
View File

@@ -0,0 +1,51 @@
---
- name: Verify representative Narratio configuration
hosts: localhost
gather_facts: false
tasks:
- name: Read the managed pipeline
become: true
ansible.builtin.slurp:
src: /usr/local/etc/narratio/pipeline.yml
register: narratio_managed_pipeline
- name: Verify representative pipeline fields
ansible.builtin.assert:
that:
- narratio_pipeline.workspace.cleanup_after_publish == false
- narratio_pipeline.campaigns.default_campaign_id == ''
- narratio_pipeline.spool.delete_audio_after_publish == false
- narratio_pipeline.cache.s3_audio == false
- narratio_pipeline.publish.enabled == false
- narratio_pipeline.publish.outputs[0].source == 'narratio.transcript.final_markdown'
- narratio_pipeline.publish.outputs[0].dest == 'transcripts/final.md'
- narratio_pipeline.publish.outputs[0].required == false
- narratio_pipeline.whisperx.retries == 0
- narratio_pipeline.seriatim.coalesce_gap == 0.0
- narratio_pipeline.seriatim.report == false
- narratio_pipeline.audita.modules == []
- narratio_pipeline.audita.report == false
- narratio_pipeline.trim.enabled == false
- narratio_pipeline.trim.bounds.render_debug == false
- narratio_pipeline.render.enabled == false
- narratio_pipeline.render.include_metadata == false
- narratio_pipeline.scriptorium.artifacts.disabled_fixture.enabled == false
- "'configkit' not in narratio_pipeline"
- "'storage' not in narratio_pipeline"
- "'normalize' not in narratio_pipeline"
vars:
narratio_pipeline: "{{ narratio_managed_pipeline.content | b64decode | from_yaml }}"
- name: Validate the representative pipeline as the Narratio account
become: true
ansible.builtin.command:
argv:
- /usr/bin/sudo
- -u
- narratio
- /usr/local/bin/narratio
- config
- validate
- --config
- /usr/local/etc/narratio/pipeline.yml
changed_when: false