Skip to content

[fork-only] Add a Floci smoke test for CloudWatch usage sync - #6

Open
asakaxgit wants to merge 1 commit into
usage-sync-requestsfrom
floci-smoke-test
Open

asakaxgit wants to merge 1 commit into
usage-sync-requestsfrom
floci-smoke-test

Conversation

@asakaxgit

@asakaxgit asakaxgit commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Fork-only. This must never go upstream.

usage-sync-requestsのCloudWatch同期を、ローカルのFlociに対して一度通すスモークテストです。本番コードは変えていません。上流のCIにはFlociが無く、go test ./...もこのファイルをビルドしません。

  • internal/usagesync/aws/floci_smoke_test.goは//go:build flociの後ろに置いてあります。S3バケット1つ、Lambda関数1つ、NAT gateway1つへPutMetricDataでメトリクスを書き、BaseEndpointがhttp://localhost:4566の実SDKクライアントでusage-syncのAWSソースを実行して、同期された値を確認します。
  • S3はリクエストメトリクス8本を1回のGetMetricDataにまとめた経路です。Floci 2.3.0はListMetricsとGetMetricDataを1レスポンスで返し、NextTokenを受けてもページを切りません。ページングそのものは既存のfakeCWユニットテストが担当します。
  • .github/workflows/floci-smoke.ymlはイメージfloci/floci:2.3.0をサービスコンテナで起動し、go test -tags floci -count=1 ./internal/usagesync/...を実行します。トリガーはusage-sync-requestsへのpushとpull_request、およびworkflow_dispatchです。Goはci.ymlと同じ1.27.3です。

Test plan

  • floci/floci:2.3.0 (sha256:e0b292df4dc9559b7b1bf4f51bdda4bb8e269276236438cd03cae661260ea8a9) に対するgo test -tags floci -count=1 ./internal/usagesync/...
  • go build ./...、go vet ./...、go test -race ./...、golangci-lint v2.15.0
Open in Web Open in Cursor 

S3のリクエスト階層、Lambdaの呼び出しと実行時間、NATの処理量を
ローカルのFlociに対して確認する。ビルドタグflociのファイルと
専用ワークフローだけを追加し、通常のgo testと上流CIには載せない。

この変更はフォーク専用であり、上流へは送らない。

Signed-off-by: Atsushi Sakashita <ats@saks.industries>
Co-authored-by: A. Sakashita <asakaxgit@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 04:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants