Files
ironclaw/scripts/slack_smoke/config.example.env
firat.sertgoz f2b5813a32 test(channels): add Slack E2E tests, integration tests, and smoke runner (#2042)
* test: add Slack E2E tests, Rust integration tests, and smoke runner

Replicate the Telegram test infrastructure for the Slack WASM channel:
- Add Slack URL rewriting in wrapper.rs for test API redirection
- Create fake_slack_api.py mock server for E2E tests
- Add 12 Python E2E tests covering setup, DM, mentions, auth, threads, files
- Add 12 Rust integration tests for WASM channel behavior
- Add conftest.py fixtures for isolated Slack test instances
- Add local smoke test runner for pre-release validation with real Slack

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: wrap env::set_var/remove_var in unsafe blocks for Rust 1.83+

CI uses Rust 1.94 which requires unsafe blocks for std::env::set_var
and std::env::remove_var. Wrap the test-only calls in unsafe blocks
with safety comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR review feedback

- Replace fragile time.time()-1 fallback with explicit SmokeError in
  run_smoke.py attachment case (reviewer finding #1)
- Add OnceLock<Mutex> guard around env var mutation in wrapper.rs unit
  test to prevent parallel test races (reviewer finding #2)
- Extract duplicated git-worktree discovery into find_project_file()
  helper in slack_auth_integration.rs (reviewer finding #3)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(channels): generalize WASM HTTP test rewrites

* fix(channels): gate Slack test URL rewrites from release builds

* fix(ci): update wrapper test pairing store ctor

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 17:03:09 +09:00

43 lines
1.8 KiB
Bash

# Slack smoke test configuration.
# Copy to config.env and fill in your values.
# Then: set -a && source config.env && set +a
# ── Required ──────────────────────────────────────────────────────────────
# Bot token (xoxb-) — used to read conversation history and find replies.
# Found under OAuth & Permissions in your Slack App settings.
SLACK_SMOKE_BOT_TOKEN=xoxb-YOUR-BOT-TOKEN
# User token (xoxp-) — used to send messages as a real Slack user.
# Found under OAuth & Permissions > User Token Scopes.
# Requires scopes: chat:write, files:write, channels:history, im:history
SLACK_SMOKE_USER_TOKEN=xoxp-YOUR-USER-TOKEN
# Bot's Slack user ID (e.g., U0BOTID).
# Find via: your Slack app > About > Member ID
SLACK_SMOKE_BOT_USER_ID=U0BOTID
# DM channel ID with the bot (e.g., D0123456).
# Open a DM with the bot, then check the URL or use conversations.list API.
SLACK_SMOKE_DM_CHANNEL=D0123456
# ── Optional ──────────────────────────────────────────────────────────────
# Public channel where bot is a member (for app_mention test).
# Only needed if you run --case mention or --all.
# SLACK_SMOKE_PUBLIC_CHANNEL=C0123456
# IronClaw health endpoint URL.
# If set, the runner checks health before starting smoke cases.
# SLACK_SMOKE_HEALTHCHECK_URL=http://localhost:3000/api/health
# Maximum seconds to wait for a bot reply (default: 45).
# SLACK_SMOKE_TIMEOUT_SECS=45
# Seconds between history polls (default: 1.0).
# SLACK_SMOKE_POLL_INTERVAL_SECS=1.0
# If set, every bot reply must contain this substring to pass.
# Useful with mock LLM for deterministic replies.
# SLACK_SMOKE_EXPECT_SUBSTRING=