CI で order scenario テストが期待した箇所で落ちることを確認する - #9
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: krrrr38 <k.kaizu38@gmail.com>
krrrr38
force-pushed
the
ci/expect-order-scenario-failure
branch
from
August 30, 2026 20:32
12ec240 to
2fdd1b4
Compare
TypeScript の order scenario だけ 4 つの独立した it に分割され、 ケースごとに userId を作り直して注文をやり直していたため、 他言語と同様に「新規注文 → 追加注文 → リバランス」を順に辿る 単一シナリオへ統合する。 併せて金額比較を expectAmount ヘルパーへ切り出し、失敗時に実測値が メッセージへ出るようにした。これにより CI の EXPECTED_FAILURE を シナリオ名ではなく他言語と同じ `asset3 Toyopa amount: got 20000, want 19000` で照合できる。 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: krrrr38 <k.kaizu38@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/scripts/expect-order-scenario-failure.shを追加EXPECTED_FAILUREで指定した文字列が出力に含まれない(=別の場所で落ちている)場合は CI を失敗させる::group::で折りたたみ、意図的な失敗ログでログが読みにくくならないようにしている.github/workflows/test-*.ymlすべて(go / java8 / java17 / php / python / ruby / scala / typescript)に、既存の portfolio scenario テストの後に order scenario テストの確認ステップを追加pathsフィルタに共通スクリプトを追加し、スクリプト変更時にも各言語の CI が動くようにした各言語で照合する期待メッセージ:
asset3 Toyopa amount: got 20000, want 19000expected 19000 but was 20000Failed asserting that two strings are identical./'19000'/'20000'assert Decimal('20000') == Decimal('19000')expect(BigDecimal(asset3_toyopa.amount_jpy)).to eq(BigDecimal("19000"))Expected 19000, but got 20000asset3: リバランス注文が正しく機能するTest plan
ローカルで実行し、スクリプトが exit 0(=期待どおりの失敗)になることを確認済み:
go test ./test/... -run TestOrderScenario./mvnw test -q -Dtest=OrderScenarioTest./mvnw test -q -Dtest=OrderScenarioTestpython -m pytest tests/test_order_scenario.pysbt "testOnly folio.codinginterview.OrderScenario"npx vitest run tests/orderScenario.test.tsassertSame失敗出力に基づく(CI の結果で確認)actionlint/ghalint run/shellcheckがすべてパス🤖 Generated with Claude Code
https://claude.ai/code/session_0163pSJYyqmQcJhji7qc69Nm