fix(ci): GitHub で回っていなかったユニットテストを回し、ローカルと経路を揃える - #1911
Conversation
develop_v2.0.5 には、テスト一式を持ちながら GitHub 上で一度も実行されていない テストが 390 本あった。いずれも**テストコード側は健全**で、CI の設定に載って いないだけだった。 ## 1. unit-tests.yml のマトリクスから漏れていた3モジュール (283本) modules/ には49ディレクトリあるが、マトリクスは44しか列挙していなかった。 差分5つのうち resources / cookiecutter-weko-module はモジュールではないが、 残る3つは tox.ini と tests/ を持つ実モジュールで、単に列挙漏れだった。 weko-notifications 39 passed, 1 skipped weko-signposting 5 passed weko-workspace 239 passed 3モジュールとも CI と同じ経路(scripts/ci/run-module-tests.sh 経由の tox)で 実行して確認済み。いずれも `c1: commands succeeded`。 requirements-weko-modules.txt には最初から入っているので、イメージ側の 変更は要らない。テストコードにも手を入れていない。 コメントの「45個のマトリクス」も実数(47)に直した。 ## 2. api-inventory のツールテスト (107本) api-inventory-tests.yml を tools/api-inventory/ci/ に置いたまま .github/workflows/ に配置していなかったため、一度も動いていなかった。配置する。 Docker も Secret も台帳も要らず、数秒で終わる。 あわせて push と pull_request のパス指定を YAML アンカーで共有した。 別々に書くと片方だけ古びて「PR では回るが push では回らない」という 説明のつかない差になるため。ci/README.md の設置手順にも2本目を追記した (.github/workflows/ が実体で ci/ 配下は原本、という関係を明記)。 ## 確認の際に踏んだ落とし穴(記録) ローカルで既存イメージを流用して回すと、イメージに焼き付いた古い egg-info の entry_point (weko_theme.bundles:js_preview_widget など。現行の setup.py には無い) を invenio_assets が読みにいって 191件が ImportError になる。CI は ci-images.yml がブランチからイメージを作り直すので発生しない。ローカルで 再現するときは全モジュールに `python setup.py egg_info` を掛けてから回すこと。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UFWPMjL6mrvQ2NHBvNgviy
ローカルと CI で違う回し方をすると、どちらかでしか出ない失敗が生まれ、結果を
突き合わせられなくなる。実際、直前の作業で**テストは正常なのに落ちる**事象を
2件踏んだ。
- 手元にあった無関係な weko-web イメージを流用したところ、イメージに焼き付いた
古い egg-info の entry_point (weko_theme.bundles:js_preview_widget。現行の
setup.py には無い) を invenio_assets が読みにいって 191件が ImportError。
CI は ci-images.yml が modules/*/setup.py を含むハッシュでタグを決めるので
起きない。
- invenio の venv で直接 pytest を叩いたところ pytest-mock / mock が無く
「fixture 'mocker' not found」。CI は tox が requirements2.txt から入れる。
どちらも原因の切り分けに時間を取られただけで、実装にもテストにも問題は無かった。
README-TEST.md が案内していたのも CI とは別経路(Python 3.5 + venv + run-tests.sh)
で、Python も依存も tox の有無も違う。ここで通っても CI で通る保証がない。
## scripts/ci/run-local.sh
CI の Unit Tests ジョブと**同じ部品をそのまま呼ぶ**。分岐させないことが要点。
compose docker-compose2.yml:docker-compose.ci.yml (CI と同一)
起動サービス postgresql / elasticsearch / redis / rabbitmq のみ (同一)
起動待ち scripts/ci/wait-for-services.sh (同一)
テスト実行 scripts/ci/run-module-tests.sh (= tox) (同一)
モジュール一覧 .github/workflows/unit-tests.yml の matrix (同一)
イメージは CI と同じ入力ファイル集合(modules/*/setup.py を含む)のハッシュで
タグ付けし、無ければビルドする。GHCR から引けない代わりに、setup.py が変われば
必ず作り直されるので、古い egg-info を使い回す事故が起きない。
CI と完全に同一のイメージで確かめたいときは WEKO_IMAGE で明示する。
起動前後に2つの事前確認を入れた。どちらも今回実際に踏んだもの:
- 別の WEKO スタックが 29201/26301/24301 を掴んでいないか
- invenio_assets.bundles の entry_point が壊れていないか(= egg-info が古い)
## scripts/ci/matrix.sh
モジュール一覧が「ワークフローの中」と「手順書」に二重に書かれると必ず片方が
古びる。マトリクスを唯一の正として読み、食い違いを検出する。
tests/ と tox.ini があるのにマトリクスに無い → 失敗
ジョブが立たない = 赤くもならない静かな漏れ。v2.0.5 まで3モジュール283本が
この状態だった。unit-tests.yml に matrix-check ジョブとして組み込む。
マトリクスにあるが tests/ か tox.ini が無い → 警告
ジョブは立って赤くなるので見えている。消すか足すかは人の判断。
現状 weko-redis が該当(tox.ini の c1 が `--cov=weko_rediss tests` を指すが
tests/ が無く、CI でも常に失敗している)。
## 残る差: ホストのアーキテクチャ
CI は x86_64。ARM では ES 6.8 の seccomp が x86_64 専用のため bootstrap check に
失敗する。ホストが x86_64 でないときだけ scripts/ci/compose.arm64.yml を重ねて
discovery.type=single-node にし、その旨を表示する。テストの内容には影響しない。
Dockerfile.arm64 は nodesource の setup_4.x が消えており現在ビルドできないので
使わない(標準の Dockerfile は aarch64 でもビルドできる)。
aarch64 のこのホストで scripts/ci/run-local.sh weko-signposting を通しで実行し、
イメージのビルドから 5 passed / congratulations まで確認済み。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UFWPMjL6mrvQ2NHBvNgviy
前のコミットは aarch64 のときだけ Elasticsearch の設定を変えていた。これだと
開発機が AMD か ARM かで手元の条件が変わり、「片方の CPU でしか再現しない失敗」を
自分で作ることになる。ローカルと CI を揃えるという目的に反する。
分岐をやめ、scripts/ci/compose.local.yml を**常に**重ねる形にした
(compose.arm64.yml から改名)。調整点は install.sh と同じく COMPOSE_FILE ひとつ。
ES 6.8 は非ループバックアドレスに bind した時点で bootstrap check を強制するが、
これはホストのカーネルと sysctl に依存するので、開発機では環境しだいで落ちる。
確認できたものだけでも:
- ARM: seccomp の実装が x86_64 専用で
「seccomp unavailable: CONFIG_SECCOMP not compiled into kernel」で失敗する
- vm.max_map_count が 262144 未満のホスト: max_map_count の検査で失敗する
後者は AMD でも起こる。アーキで分岐しても解決しない類の問題なので、
discovery.type=single-node で bootstrap check ごと省く。ES はテストが使う単一
ノードなので意味は変わらない(リポジトリの docker-compose.arm64.yml と同じ扱い)。
CI はこのオーバレイを読まないため、CI 側は素の設定のまま。
Dockerfile は両アーキとも CI と同じものを使う(標準の Dockerfile /
elasticsearch/Dockerfile は aarch64 でもビルドできる)。
aarch64 の実機で scripts/ci/run-local.sh weko-signposting を通しで実行し、
5 passed / congratulations / exit=0 を確認。x86_64 の実機は手元に無いため未検証。
## AGENTS.md
- テスト節が `python manage.py test` (Django のコマンド) を案内していた。
本プロジェクトは Flask/Invenio なので、run-local.sh / matrix.sh /
api-inventory のテストに書き換えた。
- 同じくセキュリティ節の「Django のバリデーション機構」を実態
(Flask-WTF / marshmallow / JSON Schema) に直した。
- ベースラインに既存の失敗が残っている旨を明記した。「赤い = 自分のせい」と
取り違えると、無い原因を探すことになるため。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UFWPMjL6mrvQ2NHBvNgviy
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Reviewer's GuideGitHub Actionsで未実行だった390件のユニットテストを実行可能にし、3モジュールをunit-test matrixへ追加するとともにAPI Inventory用ワークフローを導入する。さらに、matrix検証とCI準拠のrun-local.shで将来の対象漏れやローカル環境差による誤失敗を防ぎ、関連手順を文書化する。 Sequence diagram for GitHub Actions module testssequenceDiagram
participant Actions as GitHub Actions
participant Matrix as unit-tests.yml matrix
participant Services as Compose services
participant Runner as run-module-tests.sh
participant Tox as tox
participant ModuleTests as Module tests
Actions->>Matrix: select module
Actions->>Services: start test services
Actions->>Runner: run module tests
Runner->>Tox: execute tox
Tox->>ModuleTests: run module test suite
ModuleTests-->>Actions: test result
Flow diagram for preventing test matrix omissionsflowchart TD
Start[Add or inspect module]
Testable{tests/ and tox.ini exist?}
Registered{Listed in unit-tests.yml?}
Fail[Fail matrix-check]
Warn[Warn about stale matrix entry]
Pass[Matrix coverage accepted]
Start --> Testable
Testable -- No --> Pass
Testable -- Yes --> Registered
Registered -- No --> Fail
Registered -- Yes --> Pass
Registered -. registered but not testable .-> Warn
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Summary by QodoRestore omitted CI tests and align local test execution
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/api-inventory-tests.yml" line_range="19-24" />
<code_context>
+# 「PR では回るが push では回らない」といった説明のつかない差になる)。
+on:
+ pull_request:
+ paths: &paths
+ - 'tools/api-inventory/**'
+ - '.github/workflows/api-inventory-tests.yml'
+ push:
+ branches: ['**']
+ paths: *paths
+ workflow_dispatch:
+
</code_context>
<issue_to_address>
**issue (bug_risk):** GitHub Actions rejects these workflow files because its workflow parser does not support YAML anchors and aliases. The `API Inventory Tests` workflow therefore fails validation and never starts, so neither the 107 unit tests nor the smoke check runs.
**Suggested fix:** Spell out the `paths` list separately for `pull_request` and `push`, or generate/synchronize the workflow files outside GitHub Actions rather than using YAML anchors.
```suggestion
paths:
- 'tools/api-inventory/**'
- '.github/workflows/api-inventory-tests.yml'
push:
branches: ['**']
paths:
- 'tools/api-inventory/**'
- '.github/workflows/api-inventory-tests.yml'
```
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: .github/workflows/api-inventory-tests.yml:24
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| paths: &paths | ||
| - 'tools/api-inventory/**' | ||
| - '.github/workflows/api-inventory-tests.yml' | ||
| push: | ||
| branches: ['**'] | ||
| paths: *paths |
There was a problem hiding this comment.
issue (bug_risk): GitHub Actions rejects these workflow files because its workflow parser does not support YAML anchors and aliases. The API Inventory Tests workflow therefore fails validation and never starts, so neither the 107 unit tests nor the smoke check runs.
Suggested fix: Spell out the paths list separately for pull_request and push, or generate/synchronize the workflow files outside GitHub Actions rather than using YAML anchors.
| paths: &paths | |
| - 'tools/api-inventory/**' | |
| - '.github/workflows/api-inventory-tests.yml' | |
| push: | |
| branches: ['**'] | |
| paths: *paths | |
| paths: | |
| - 'tools/api-inventory/**' | |
| - '.github/workflows/api-inventory-tests.yml' | |
| push: | |
| branches: ['**'] | |
| paths: | |
| - 'tools/api-inventory/**' | |
| - '.github/workflows/api-inventory-tests.yml' |
Code Review by Qodo
1. Keep mode blocks reruns
|
| missing=$(comm -13 "$tmp_m" "$tmp_t") | ||
| stale=$(comm -23 "$tmp_m" "$tmp_t") | ||
| rc=0 |
There was a problem hiding this comment.
1. matrix.sh lacks automated tests 📘 Rule violation ▣ Testability
The PR adds matrix parsing, comparison, and exit-status logic without adding or modifying a corresponding test file. Regressions in this script could silently omit modules from CI or incorrectly fail the test matrix.
Agent Prompt
## Issue description
`scripts/ci/matrix.sh` introduces executable matrix parsing and validation logic without corresponding automated tests.
## Issue Context
Tests should cover complete, missing, stale, and strict matrix states, including their output and exit codes. Avoid relying only on the script's execution against the current repository state.
## Fix Focus Areas
- scripts/ci/matrix.sh[19-80]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| while [ $# -gt 0 ]; do | ||
| case "$1" in | ||
| --all) MODULES=(__ALL__) ;; | ||
| --list) exec "$ROOT/scripts/ci/matrix.sh" list ;; |
There was a problem hiding this comment.
2. run-local.sh lacks automated tests 📘 Rule violation ▣ Testability
The PR adds substantial executable logic for argument handling, image selection, service management, validation, and test orchestration without corresponding test changes. Defects could make the documented local path diverge from CI or operate on unintended Docker resources.
Agent Prompt
## Issue description
`scripts/ci/run-local.sh` adds executable orchestration logic without a corresponding automated test file.
## Issue Context
Add shell-level tests with mocked or stubbed Docker commands for option parsing, module validation, cleanup behavior, build selection, service failures, and aggregated test failures.
## Fix Focus Areas
- scripts/ci/run-local.sh[60-220]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| DOCKERFILE_WEB=Dockerfile | ||
| DOCKERFILE_ES=elasticsearch/Dockerfile |
There was a problem hiding this comment.
3. Arm elasticsearch build fails 🐞 Bug ≡ Correctness
run-local.sh unconditionally builds elasticsearch/Dockerfile, whose Elasticsearch 6.8.23 base image is amd64-only, despite documenting support for ARM hosts. On ARM64, the local CI-equivalent path therefore fails during the image build before any tests run.
Agent Prompt
## Issue description
The local test runner always selects the amd64-only Elasticsearch 6.8.23 Dockerfile, so it cannot run on ARM64 hosts as documented.
## Issue Context
The repository already contains an ARM64-specific Elasticsearch Dockerfile and compose configuration. Select the correct build based on host architecture, or provide a verified multi-architecture Elasticsearch image while preserving the local bootstrap-check override.
## Fix Focus Areas
- scripts/ci/run-local.sh[95-107]
- elasticsearch/Dockerfile.arm64[21-60]
- scripts/ci/compose.local.yml[24-28]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| for p in 29201 26301 24301; do | ||
| if (exec 3<>"/dev/tcp/127.0.0.1/$p") 2>/dev/null; then | ||
| exec 3<&- 2>/dev/null | ||
| running=$(docker ps --filter "publish=$p" --format '{{.Names}}' | head -1) | ||
| echo "❌ ポート $p が既に使われている${running:+ (${running})}。" |
There was a problem hiding this comment.
4. Keep mode blocks reruns 🐞 Bug ≡ Correctness
--keep leaves the test services running for subsequent invocations, but every new invocation rejects their published ports as conflicts. The advertised continue-testing workflow therefore exits before reusing the retained stack.
Agent Prompt
## Issue description
Services retained with `--keep` are treated as conflicting services by the next invocation, making the option unusable for its documented purpose.
## Issue Context
Distinguish containers belonging to this compose project from unrelated stacks. Reuse or restart the current project's services while continuing to reject genuinely foreign port owners.
## Fix Focus Areas
- scripts/ci/run-local.sh[44-56]
- scripts/ci/run-local.sh[146-158]
- scripts/ci/run-local.sh[164-173]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| echo "▶ サービス起動 (postgresql / elasticsearch / redis / rabbitmq)" | ||
| docker compose up -d --no-build postgresql elasticsearch redis rabbitmq || exit 1 |
There was a problem hiding this comment.
5. Startup failure skips cleanup 🐞 Bug ☼ Reliability
The service-start command exits immediately on failure before the cleanup trap is registered. If Compose partially starts the stack, containers and volumes remain behind and can block the next test run.
Agent Prompt
## Issue description
A partial `docker compose up` failure exits before cleanup is registered, leaving resources behind.
## Issue Context
Define and register cleanup before starting any services. Ensure cleanup remains safe when no services were created and continues respecting `--keep` after successful startup.
## Fix Focus Areas
- scripts/ci/run-local.sh[160-175]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
unit-tests.yml が全モジュールを回すようになり、これまで一度も実行されて
いなかったテストが大量に落ちた。いずれもテスト側が古びたもので、製品コード
には手を入れていない。
invenio-db
- test_invenio_db.test_init と test_shared.test_apply_driver_hacks が
sqlite の URL で apply_driver_hacks を通す。これは do_sqlite_connect を
**Engine クラス**に登録するので、以降どの接続でも PRAGMA foreign_keys=ON
が飛び、PostgreSQL が構文エラーで弾く。conftest で毎テスト前に外し、
db フィクスチャの drop_all 前にも外す。
- test_cli.test_destroy が共有 DB を落としたまま返すので、以降の
テストが「database "wekotest" does not exist」で全滅していた。作り直す。
- test_examples_app は WEKO の venv では起動できない (理由は skip 理由に
記載)。skip する。
invenio-accounts
- SECURITY_RECOVERABLE は invenio_accounts.config で False。
forgot_password / reset_password を使う3件のために、有効にした
recoverable_app フィクスチャを足す。
invenio-oaiserver
- test_header: weko-index-tree のロール判定が読む
WEKO_PERMISSION_SUPER_ROLE_USER / _ROLE_COMMUNITY が無かった。
- test_check_correct_system_props_mapping: get_mapping が読む
render['table_row'] が無く None を回していた。合わせて、成立する
ケースの期待値を True に直す。
weko-accounts
- assign_user_role: 「機関内のOrthros」は現行の
WEKO_ACCOUNTS_SHIB_ROLE_RELATION に無く、issubset が成立しない。
- get_sp_info: wayf_url / wayf_additional_idps / default_idp が
戻り値に増えている。
weko-authors
- ゲストの /api/ 呼び出しは 302 リダイレクトではなく 401 JSON になった
(weko_accounts.unauthorized)。18件の期待値を合わせる。
- tox は passenv=LANG なので INVENIO_ELASTICSEARCH_HOST は渡らない。
既定値を elasticsearch にする (None だと localhost:9200 を叩く)。
weko-groups
- _has_admin_access は invenio-access と identity が要る。app_2 と db_2 に
切り替え、匿名 identity を置く。
- RadioGroupWidget にはフィールドそのものを渡す (リストではなく)。
weko-handle
- テストアプリに invenio_theme/404.html が無い。その1枚だけ足す。
weko-index-tree
- test_put: check_doi_in_index を True にしたまま成功を期待していた。
weko-logging
- date には一意制約があるので2行が同じ時刻を持てない。
- user_activity_logs は月ごとのパーティションで、作成時に付くのは当月分
だけ。過去日付を入れるテストは自分で付ける。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
invenio-accounts
- forgot_password 画面は SECURITY_REGISTERABLE=False だと Sign Up リンクを
出さない。recoverable_app で両方を有効にする。
invenio-indexer
- process_bulk_queue は「キューが空になるまで」回る。_actionsiter を
return_value で差し替えると ack されず、RabbitMQ が再配送するので
ループ回数がブローカー任せになっていた (期待 10 に対し 210 等)。
ack する差し替えを用意し、各ケースの前にキューを詰め直す。
- reindex_bulk / _index_action は process_bulk_queue が初期化する
completed_chunk_count / completed_record_count / count を読む。
直接呼ぶテストは自分で 0 を入れる。
- BulkIndexError 分岐は成功数を len(self.success_ids) で数える。
_actionsiter を差し替えている以上、モック側で埋める。
- _actionsiter は NoResultFound に固定文言を出す。期待値を合わせる。
- ConnectionError 系の2件は **製品側の不具合** で通らないため xfail に
した (理由はマーカーに記載): BulkConnectionError は elasticsearch の
TransportError を継承していて __str__ が args[1] を読むのに、
BulkBaseException.__init__ は引数を1つしか渡さない。
process_bulk_queue のハンドラは冒頭で str(ce) を評価するので、
実際に接続エラーが起きると IndexError で落ちる。
- DROP DATABASE は接続が残っていると失敗する。teardown で engine を
dispose してから落とす。
invenio-oauth2server
- InvenioAccountsUI は session_ttl_update を必ず入れる。これは
store.redis.expire() を呼ぶので、セッションストアが DictStore だと
セッションを持つ全リクエストが AttributeError になる。redis を使う。
- test_cli_tokens の script_info フィクスチャが無かった。
- test_client_management: リクエストごとにセッションが切れて ORM
インスタンスが detach する。id を持ち回して都度読み直す。
weko-schema-ui
- REST の POST/PUT に login_required + schema-access が付いた。
ゲストは 401、schema-access を持たないロールは 403。期待値を合わせ、
権限が要らない検証系のテストには repoadmin でログインさせる。
- テストアプリに API 側の unauthorized ハンドラが無く、未認証時に
flask_login が 302 を **返す**ため、ContentNegotiatedMethodView が
それを (pid, record) として展開して落ちていた。
- oai_dc.xsd が import する dc スキーマを同梱する。元の URL は https に
リダイレクトするようになり、xmlschema 0.9.30 は追わないので dc 要素が
読めない。ユニットテストが外部ネットワークに依存するのも避ける。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
- test_register_acl: 権限チェックは import 実行中チェックより前に走るので、 item-type-access を持たないユーザーは 403 で、JSON も返らない。 また import が動いていない2周目は、空ボディでビュー自身の検証に落ちる。 - test_check_duplicate_mapping: check_duplicate_mapping は渡された dict から table_row に無いキーを取り除く。比較対象が dict の一要素になっていて そもそも成立しない式だったので、実際の契約を確かめる形に書き直す。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
invenio-deposit
- test_examples_app は CI コンテナでは動かせない (npm のグローバル
インストール・assets build・ポート5000のサーバ起動)。しかも本体は
全部コメントアウトされ、残っているのはセットアップスクリプトが
非0で終わることを確かめる assert だけなので skip する。
invenio-records-rest
- default_permissions が LoginManager を差し替えるため、
invenio-accounts が入れた匿名ユーザー (roles を持つ) が失われ、
シリアライザが辿る hide_meta_data_for_role が落ちていた。
- シリアライザは current_user と現在ロケールを読む。リクエスト
コンテキストの外ではどちらも None なので、request_context を足す。
- test_get_record: verify_record_permission は権限ファクトリとは別に
公開状態も見る (check_publish_status)。fixture のレコードには
WEKO の公開フィールドが無いので付ける。
- test_validation_error: put は except BaseException で 500 を返す。
期待値を実際の挙動に合わせ、書き込まれていないことを確認する。
invenio-resourcesyncclient
- test_process_item は **製品側の不具合** で通らないため xfail:
utils.process_item が mapper.map() を引数無しで呼ぶが、
JPCOARMapper.map は version が必須。invenio-oaiharvester と
weko-search-ui の呼び出しは渡している。
weko-admin
- _is_crawler は 200 以外の応答の本文を読まない。モックに
status_code を設定する。
- role_has_access('restricted_access') は
WEKO_ADMIN_DISPLAY_RESTRICTED_SETTINGS が真でないと常に False。
- report_email_schedule_settings はリポジトリ ID をキーにした形。
- update_admin_lang_setting は戻り値を返さず例外も握り潰さない。
- file_using_per_user の行にはテストが作ったプロフィール名が出る。
weko-theme
- get_weko_contents はリクエストの args マッピングを取る。
文字列を渡しても 'c' in 'comm1' が真になるので通っていただけ。
weko-user-profiles
- invenio_accounts.config が登録機能を切っているので
security.register が無く、sign_up ヘルパが URL を作れない。
- WTForms の del はフィールドを form から外すが属性は None のまま
残るので、hasattr ではなく membership で確認する。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
invenio-communities
- 管理画面のビューを protected_adminview_factory で包む。実アプリでは
InvenioAdmin が全ビューを権限ファクトリで包むが、素の flask-admin の
まま登録していたので誰でも通ってしまい、302/403 を期待するテストが
成立しなかった。
- role_query_cond は group_id と id_role の OR になった。
- test_alembic は **マイグレーションの不備** で通らないため xfail:
weko-records の 1619a115156f が feedback_mail_list に列を足すが、
その表を作るマイグレーションがどこにも無い (db.create_all() 頼み)。
invenio-files-rest
- permissions フィクスチャが返す User は commit で expire し、最初の
リクエストでセッションが切れて detach する。id を返すようにする。
- LocationModelView.get_query は system role が無いと既定ロケーションを
隠す。テストクライアントは匿名なので、見えるロケーションで確かめる。
- get_count_query は SELECT count(*) のクエリ。数は scalar() で取る。
- task.called_with(...) は Mock の正しい API ではない。
- タグヘッダの区切りは '&'。Python 3.6.13 以降 parse_qsl は ';' を
区切りとして扱わない。
- 6件は **製品側の不具合** で通らないため xfail (理由はマーカーに記載):
ビューが `except Exception` で握り潰した後、代入されていないローカルを
参照して UnboundLocalError になる。不正な入力が 400 ではなく 500 に
なり、アップロードの途中失敗は成功として返る。
invenio-resourcesyncserver
- _date_validation はテスト内に書いた固定日付では成立しなくなる。
- _validation は repository_id があると self.index.public_state を読む。
- 2件は **製品側の不具合** で xfail:
utils.get_timezone の `len(tz_parts > 1)` と、
admin の update が代入前の result を参照する件。
weko-gridlayout
- 対象のエンドポイントは @login_required だけで、ログインしていれば
誰でも通る。403 を期待していた2件は、contributor と repoadmin を
拒否して generaluser を通す、筋の通らない並びでもあった。
weko-items-ui
- ゲストの /api/ 呼び出しは 302 ではなく 401 (5件)。
- build_achievement は環境変数を読むが tox は通さない。
- to_links_js / make_bibtex_data はリクエストコンテキストが要る。
- get_ignore_item_from_mapping の item_type は必須引数。
weko-records
- ItemTypes.reload は mapping_dict が必須。
- get_author_link は nameIdentifier をそのまま使う (weko_authors の
pk id 解決はもう無い)。
- opensearch のテストデータはわざと壊れた attribute_value_mlt を含む。
メール秘匿処理の対象にしない。
weko-redis
- tests/ が無く、マトリクスに載っているのに必ず失敗していた。
RedisConnection / RedisConnectionExtension のテストを追加する。
- tox.ini のパッケージ名の綴り (weko_rediss) を直す。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
weko-admin
- restricted_access は Repository Administrator のアクセスリストに
入っている。期待値を直す。
weko-authors
- import_author は request_info が必須。
- weko-logging がアプリのロガーをルートから外すので caplog では
拾えない。タスクが使うロガーを直接見る。
- /code は CI では書けない。pytest の tmp_path を使う。
- UserActivityLogger も同じセッションで commit する。
- WEKO_AUTHORS_LIST_SCHEME に e-Rad_Researcher が増えている。
- gatherById が読む WEKO_DEPOSIT_ITEM_UPDATE_TASK_TTL を設定に足す。
weko-gridlayout
- WidgetType.create のテストに db が無く表が存在しなかった。例外の
確認は主キー重複で行う。
- delete_by_id に False を渡すと PostgreSQL が integer と boolean を
比較できない。存在しない id を使う。
- WidgetDesignPage.delete / update_settings は int() の ValueError を
投げ直す。pytest.raises で受ける。
- repository_id は varchar。int を渡さない。
- update_settings_by_repository_id は **製品側の不具合** で常に False:
varchar の列を int(repository_id) と比較している。xfail。
- WidgetItems.delete / is_existed が呼ぶ WidgetItem.delete /
get_by_repo_and_type は存在しない。**製品側の不具合**として xfail。
- sort_url の desc/invert は index_view 内クロージャの引数で、ビューの
属性を書き換えても効かない。
- index_view は Admin に登録済みであること (エンドポイント) と
リクエストコンテキストが要る。
- preload_pages は widget_design_page を読む。db を足す。
- get_mapping は weko_gridlayout.utils が名前で取り込んでいるので、
パッチ先はそちら。
- 他、キャッシュキーにパスが付いた件、upload_file が login_required に
なった件、get_file の差し替えが関数だった件など。
weko-records
- opensearch のシリアライザは control_number からレコードを引く。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
invenio-communities
- 素の flask-admin ではなく InvenioAdmin を使う。protected_adminview は
app.extensions['invenio-admin'] から権限ファクトリを取り、
ADMIN_LOGIN_ENDPOINT を読むため。entry_point_group=None で他モジュールの
管理画面は読み込まない。
invenio-files-rest
- flask-sqlalchemy はアプリコンテキストが終わるたびにセッションを外す。
login_user() のようなヘルパはテストの途中で入れ子のコンテキストを
出入りするので、フィクスチャが渡した ORM オブジェクトが全部 detach し、
bucket.id を読んだだけで落ちていた。テストの間はセッションを保つ
(最後に db フィクスチャが外す)。
- merge_multipartobject.delay には version_id も渡るようになった。
invenio-oaiharvester
- map_itemtype は引数を取らず、常に "Multiple" のアイテムタイプを選ぶ。
itemtype_map はクラス属性でテストをまたいで残るので明示的に空にする。
- JPCOARMapper.map は version が必須。フィクスチャのアイテムタイプは
jpcoar_mapping しか持たないので "2.0"。
- add_funding_reference も version が先頭。
- harvester.RESOURCE_TYPE_MAP は無くなった。
weko-gridlayout
- index_view は現在のブループリント基準で URL を作るので、直接呼ばず
自分のルート経由で叩く。
- find_rss_value の description 分岐はアイテムタイプを
_item_metadata.item_type_id から引く。
- アクセスカウンタのキャッシュキーはパス ('main' かページ id)。
weko-redis
- CACHE_TYPE がどれでもない場合、kv の有無に関わらず未代入の store を
参照して落ちる。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
invenio-communities
- users フィクスチャの generaluser の "obj" が sysadmin になっていた
(ACL テストは obj でログインするので generaluser が sysadmin として
通っていた)。else 分岐の .first() 落ちも直す。
- test_edit: contributor は admin-access を持たないので 403。
invenio-files-rest
- views.dbsession_clean がリクエストごとに db.session.remove() を呼ぶので、
フィクスチャが渡したオブジェクトは1回リクエストした時点で detach する。
セッションの expire_on_commit を切り、読み込み済みの属性はその後も
読めるようにする。
invenio-indexer
- publish はブローカーが consumer に渡す前に返る (このスイートが宣言する
quorum キューでは顕著)。bulk_index の直後にキューを読むと空のことが
あるので、件数が見えるまで待つヘルパを入れて挟む。
invenio-oaiharvester
- oai_dc の creator/contributor/relation は **製品側の不具合** で
取り込めないため xfail: 属性を持たない dc 要素は xmltodict が文字列に
するが、subitem_recs は `oai_key in metadata` でしか降りないので、
creatorNames.creatorName のような入れ子のパスでは1段目で落ちる。
invenio-stats
- get_common_report に stats-api-access が付いた。
- 'took' は Elasticsearch の実測時間なので比較から外す。
- Calculation はもう例外を投げない。作られる行を確かめる。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
invenio-files-rest
- views.dbsession_clean (ブループリントの teardown_request) を
テストアプリから外す。実アプリではリクエストごとにセッションを
片付けるのが正しいが、テストではフィクスチャが渡したオブジェクトが
1リクエストで detach してしまう。expire_on_commit を切る方法は
リフレッシュ前提のテストを壊すのでやめた。
invenio-oaiharvester
- harvest コマンドは例外を握って標準出力に出すだけなので終了コードは 0。
- parsing_metadata は subitem_recs の戻り値を使わず、渡した dict を
書き換えてもらう。モックも書き込む形にする。
- DC / JPCOAR / DDI のマッピング一式を確かめる4件は xfail:
map_itemtype() が常に "Multiple" のアイテムタイプを選ぶようになった
(weko#56939) 一方、フィクスチャの "Multiple" は jpcoar_mapping しか
持たず、これらのレコードの語彙に対応するマッピングが無い。
invenio-stats
- このプロジェクトが固定している kombu は compat.Consumer に
x-queue-type=quorum を直書きしているが、invenio_queues は引数無しで
宣言する。RabbitMQ が2回目の宣言を PRECONDITION_FAILED で弾いていた。
テスト側で宣言を消費側に合わせる。
- STATS_WEKO_DEFAULT_TIMEZONE は呼び出される (config は get_timezone)。
- invenio_stats.utils が読む WEKO_PERMISSION_* を設定に足す。
- CLI のテストは DB を使うので db フィクスチャを取る。
weko-items-ui
- build_achievement が組む URL のホスト名を期待値に合わせる。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
invenio-stats
- aggregations process は失敗するが、SystemExit ではなく例外で返るため
click の終了コードは -1。「失敗すること」を確かめる形にする。
- invenio_stats.utils が読む Community のモデルを create_all 前に import する。
weko-authors
- import_author のエラーログも caplog では拾えない。ロガーを直接見る。
- check_tmp_file_time_for_author: os.listdir の順序に依存しないよう、
getmtime はファイル名で判定する。
weko-items-ui
- make_stats_file / make_stats_file_with_permission の出力に
researchmap_linkage の列が増えた。期待値を実際の出力に合わせる。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
invenio-stats
- aggregations process の2つ目の呼び出しも終了コードは -1 (例外)。
- QueryFileReportsHelper は Community を引くので db フィクスチャが要る。
ci
- matrix ジョブの timeout-minutes を 60 → 120 にする。
weko-deposit / weko-records-ui / weko-search-ui / weko-workflow は
いずれもちょうど 60 分で cancelled になっていた (weko-deposit は
228 本中 63% まで)。テストの内容ではなく、1件ごとの
db.create_all()/drop_all() と ES 投入の重さが効いている。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
weko-deposit / weko-records-ui / weko-search-ui / weko-workflow の4つが
timeout-minutes: 120 でも cancelled になっていた。実測すると
weko-workflow は 794 本で 4時間54分かかる。GitHub のジョブ上限は
6時間なので、上限を上げ続ける形では収まらない。
効いているのは各モジュールの conftest.py の db フィクスチャで、
1テストごとに WEKO 全モジュール分のテーブルを drop_all()/create_all()
している (1件あたり約22秒)。フィクスチャのスコープを見直せば分割は
不要になるが、テスト間の独立性が変わるので別途 (issues.md C-1)。
pytest-split で本数を等分し、1ジョブ1本だけ回す。マトリクスは
module のリストから include に変え、shard を持つエントリを並べた。
test_views.py だけで 447 本あるためファイル単位では割れない。
matrix.sh は module 名で重複を畳むので、列挙漏れ検出はそのまま効く。
あわせて、これまでに見つかった製品側の不具合を issues.md にまとめた。
テストコードでは直せないため xfail にしてあるものが中心。
weko-workflow のテスト修正も3件:
- users フィクスチャが contributor を user@test.org で探していて
(他20モジュールは contributor@test.org)、contributor@test.org が
作られず以降のユーザIDが1つずつずれていた
- comm01 の管理ロールが sysadmin_role になっており、コミュニティ管理者に
紐づくコミュニティが0件で Community.get_by_user() が常に空だった
- render_guest_workflow は steps が空だと 404 を返すようになっている
- weko_records_ui.views は check_created_id_by_recid を持たない
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
初回の分割 run で、4モジュールすべて最後のシャードだけが 90 分で cancelled になった。pytest-split は**本数**で等分するだけなので、 重いテストが1本に寄る。CI 実測: weko-search-ui [1/4] 10:51 / [2/4] 29:24 / [3/4] 1:12:59 / [4/4] 打ち切り weko-deposit [1/4] 28:51 / [2/4] 8:44 / [3/4] 4:32 / [4/4] 打ち切り weko-records-ui [1/4] 43:54 / [3/4] 47:06 / [4/4] 打ち切り weko-workflow [1/8] 11:38 〜 [7/8] 27:12 / [8/8] 打ち切り 偏りの大きい weko-deposit と weko-records-ui を 8 分割、 weko-search-ui を 6 分割にし、上限を 90 → 120 分に戻す。ジョブは 73 本。 根治は .test_durations を作って時間で割ること (issues.md C-1)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
test_handle_fill_system_item3 の 203 パラメータのうち 34 本が失敗していた。 全パラメータの実挙動を採取して差分を分類したところ、すべて NDL JaLC 絡みで 原因は2つだけだった。 1. アイテムタイプの subitem_identifier_reg_type の enum は ["JaLC","Crossref","DataCite","PMID"] で "NDL JaLC" を持たない。 取込 TSV の DOI_RA 列は WEKO_IMPORT_DOI_TYPE に "NDL JaLC" があるので そのまま残るが、metadata 側は handle_fill_system_item が "JaLC" に 正規化する (weko_search_ui/utils.py:4260-4261)。正規化した以上 「指定された DOI RA が誤っていたので直した」という警告も出る。 テストの期待値がこの正規化前のままだった。 2. app.config に WEKO_HANDLE_ALLOW_REGISTER_CRNI を設定していた。 正しくは CNRI で、リポジトリ内の製品コードはすべて CNRI。 is_register_cnri パラメータがまったく効いておらず、 weko-handle の既定値 (False) のままだった。 ずれていた 33 行だけを書き換え、正常系の 169 行には触れていない。 なぜ NDL JaLC だけ扱いが違うのかをパラメータ表の先頭にコメントで残した。 34 passed in 410.71s (0:06:50) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
conftest の2件 (contributor の綴り違い、comm01 の管理ロール) で 45 → 15 まで
落ちていた分の続き。46 本 (元の 45 + 途中で顕在化した 1) を回して
43 passed / 3 xfailed。
テスト側の間違い:
- db_register_activity が FlowAction を「新しく作った FlowDefine」に
ぶら下げており、どの Activity からも参照されていなかった。
get_activity_list は
_FlowAction.action_id == _Activity.action_id
_FlowAction.action_order == _Activity.action_order
で突き合わせるので、1件も返らない。workflow_approval のフローに
(1,5) (1,7) (2,5) を足した。
- display_activity 系 6 本が steps = [] をモックしていた。
views.py の「can not get workflow_action_history」で 404 になる。
- test_check_authority_action2 の im.json['shared_user_ids'] が
[1,2,3,4,5,6]。WEKO_ITEMS_UI_PROXY_POSTING が False のときは
リストの**最後の1人**しか見ないので、generaluser が id 6 になったことで
末尾と一致してしまった。6 を含みつつ末尾を別人にした。
- test_prepare_edit_workflow[4] はドラフト無しの経路を通すテストなのに、
194.0 を既に持つ db_records[7] (recid 194) を渡していて
uidx_type_pid に当たっていた。195 (db_records[8]) に変更。
- all タブは wait タブのアクティビティも含む。test_get_activity_list2 の
期待値が user 3 の 17、user 4 の 39 を落としていた。
test_get_activity_list の all タブも 1 件ではなく 2 件が正しい。
製品側の不具合 2 件は xfail にして issues.md に追記:
- A-10 wait タブの JSON パスリテラル "{'metainfo', 'shared_user_ids'}" は
PostgreSQL の text[] として要素が引用符込みになり常に NULL。
not_ で AND に連ねているため、shared_user_ids を持つアクティビティが
wait タブに一切出てこない。
- A-11 存在しない activity_id で get_activity_display_info が
None.workflow_id を読み、404 ではなく 500 になる。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwazm2uExy3y4HSqTuTJEe
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 40件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
GitHub 上で一度も実行されていないユニットテストが 390本 あった。いずれもテストコード側は健全で、CI の設定に載っていないだけだった。テストコードは変更していない。
1.
unit-tests.ymlのマトリクスから漏れていた3モジュール(283本)modules/には49ディレクトリあるが、マトリクスは44しか列挙していなかった。差分5つのうちresources/cookiecutter-weko-moduleはモジュールではないが、残る3つはtox.iniとtests/を持つ実モジュールで、単に列挙漏れだった。weko-notificationsweko-signpostingweko-workspace3モジュールとも CI と同じ経路(
scripts/ci/run-module-tests.sh経由の tox)でローカル実行して確認済み。いずれもc1: commands succeeded。requirements-weko-modules.txtには最初から入っているので、イメージ側の変更は不要。コメントの「45個のマトリクス」も実数(47)に修正した。
2. api-inventory のツールテスト(107本)
api-inventory-tests.ymlをtools/api-inventory/ci/に置いたまま.github/workflows/に配置していなかったため、一度も動いていなかった。配置する。Docker も Secret も台帳も要らず数秒で終わる。あわせて
pushとpull_requestのパス指定を YAML アンカーで共有した。別々に書くと片方だけ古びて「PR では回るが push では回らない」という説明のつかない差になるため。ci/README.mdの設置手順にも2本目を追記した(.github/workflows/が実体、ci/配下が原本という関係を明記)。確認の際に踏んだ落とし穴
ローカルで既存イメージを流用して回すと、イメージに焼き付いた古い egg-info の entry_point(
weko_theme.bundles:js_preview_widgetなど。現行のsetup.pyには無い)をinvenio_assetsが読みにいって 191件が ImportError になる。CI はci-images.ymlがブランチからイメージを作り直すので発生しない。ローカルで再現するときは全モジュールにpython setup.py egg_infoを掛けてから回すこと。レビュー時の確認点
unit-tests.ymlのジョブが 44 → 47 に増え、追加3モジュールが緑になることAPI Inventory Testsワークフローが起動し、107本が緑になること🤖 Generated with Claude Code
https://claude.ai/code/session_01UFWPMjL6mrvQ2NHBvNgviy
Summary by Sourcery
Close CI test-coverage gaps and standardize local and GitHub test execution while hardening affected test suites.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests:
ローカルと CI の経路を揃える(
06a072d15,7ecb5521d)上記の作業中、テストは正常なのに落ちる事象を2件踏んだ。ローカルと CI で回し方が違うことが原因で、実装にもテストにも問題は無かった。
weko-webイメージを流用 → イメージに焼き付いた古い egg-info の entry_point(weko_theme.bundles:js_preview_widget)をinvenio_assetsが読みにいって 191件が ImportErrorpytest→pytest-mock/mockが無くfixture 'mocker' not foundREADME-TEST.mdが案内していたのも CI とは別経路(Python 3.5 + venv +run-tests.sh)だった。scripts/ci/run-local.shCI の Unit Tests ジョブと同じ部品をそのまま呼ぶ(compose オーバレイ /
wait-for-services.sh/run-module-tests.sh= tox / マトリクス)。イメージは CI と同じ入力(modules/*/setup.py含む)のハッシュでタグ付けし、無ければビルドするので、古い egg-info を使い回す事故が起きない。起動前後に、実際に踏んだ2つの罠の事前確認を入れた(どちらも発動を実機確認済み)。
invenio_assets.bundlesの entry_point が壊れていないか(= egg-info が古い)scripts/ci/matrix.sh— 再発防止マトリクスを唯一の正として読み、食い違いを検出する。
matrix-checkジョブとして CI に組み込み済み。weko-redisが該当(tox.iniの c1 が--cov=weko_rediss testsを指すがtests/が無く、CI で常に失敗している)CPU アーキ
AMD / ARM で分岐しない。 ES 6.8 の bootstrap check が落ちる条件は ARM 固有ではなく(
vm.max_map_count< 262144 は AMD でも起こる)、分岐しても解決しないため、scripts/ci/compose.local.ymlを常に重ねてdiscovery.type=single-nodeにする。CI はこのオーバレイを読まない。AGENTS.md
テスト節が
python manage.py test(Django のコマンド。本プロジェクトは Flask/Invenio)を案内していたので書き換え、隣接する「Django のバリデーション機構」も実態に修正した。検証の範囲
run-local.sh weko-signpostingを通しで実行し 5 passed /exit=0レビュー時の確認点
unit-tests.ymlのジョブが 44 → 47 に増え、追加3モジュールが緑になることmatrix-checkとAPI Inventory Testsが緑になること