Skip to content

test(cli): expand Open-Meteo e2e coverage#219

Open
yada wants to merge 1 commit into
reshaprio:mainfrom
yada:cli-e2e-open-meteo
Open

test(cli): expand Open-Meteo e2e coverage#219
yada wants to merge 1 commit into
reshaprio:mainfrom
yada:cli-e2e-open-meteo

Conversation

@yada

@yada yada commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary:

This PR expands the existing Open-Meteo CLI Vitest e2e scenario so it validates the MCP behavior exposed by the gateway, not only the import and exposition control-plane state.

Changes:

  • switch the Open-Meteo scenario to reusable CLI, cleanup, and MCP helpers
  • keep Open-Meteo scenario constants local to the scenario test
  • split the scenario into named sequential Vitest steps for traceable e2e output
  • validate imported service metadata and operation count
  • validate active exposition backend configuration
  • validate MCP initialize through the gateway
  • validate MCP tools/list exposes get_v1_forecast
  • call get_v1_forecast through MCP and assert the backend payload shape
  • delete the imported service before logout and verify it cannot be fetched anymore
  • verify logout removes the CLI config file from the isolated e2e home
  • keep fallback cleanup in afterAll so partial failures still remove the imported service

Validation:

cd cli
npm run build
npm exec tsc -- --noEmit --target es2022 --module es2022 --moduleResolution node --strict --esModuleInterop --skipLibCheck e2e/global-setup.ts e2e/helpers/*.ts e2e/scenarios/*.ts
npm run test:e2e -- --reporter=verbose

Closes #218

@yada yada added enhancement New feature or request github_actions Pull requests that update GitHub Actions code labels Jun 18, 2026
@lbroudoux lbroudoux added chore theme/build theme/cli and removed enhancement New feature or request github_actions Pull requests that update GitHub Actions code labels Jun 18, 2026
@lbroudoux lbroudoux added this to the 0.0.15 milestone Jun 22, 2026
@lbroudoux

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

@lbroudoux

Copy link
Copy Markdown
Member

Think it needs a rebase and some conflict resolution. Then remove the draft status.

@yada yada force-pushed the cli-e2e-open-meteo branch from d46e1cc to e969987 Compare June 22, 2026 19:19
@yada yada marked this pull request as ready for review June 22, 2026 19:22
@yada yada requested a review from lbroudoux as a code owner June 22, 2026 19:22
// ── Step 2 ─────────────────────────────────────────────────────────────────
test('import OpenAPI artifact with backend endpoint', async () => {
const result = await runCli(
test('imports Open-Meteo, exposes it, and serves MCP tools', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok but this it no longer a scenario as everything is now packed into a single test/step. Wouldn't it be easier for error tracking purpose to split into different steps/methods/tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I checked the verbose Vitest output (run locally), and I agree with your point. The current test passes, but the report now only shows one scenario-level test:

imports Open-Meteo, exposes it, and serves MCP tools

Working on it to see how I can split tests into smaller steps for better traceability.

@yada yada force-pushed the cli-e2e-open-meteo branch from e969987 to f5d6d59 Compare June 23, 2026 13:18
@yada

yada commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

Tested locally and here the output now ;)

Verbose e2e output now includes:

  ✓ ... > logs in and removes stale Open-Meteo service
  ✓ ... > imports Open-Meteo with backend endpoint
  ✓ ... > validates imported service metadata and operations
  ✓ ... > validates active exposition backend configuration
  ✓ ... > initializes MCP endpoint through gateway
  ✓ ... > lists Open-Meteo MCP tool
  ✓ ... > calls Open-Meteo forecast tool through MCP

  Test Files  1 passed (1)
  Tests       7 passed (7)

Comment thread cli/e2e/scenarios/import-and-expose-basic.e2e.test.ts
Signed-off-by: Yacine Kheddache <yacine@microcks.io>
@yada yada force-pushed the cli-e2e-open-meteo branch from f5d6d59 to 446dd0e Compare June 23, 2026 15:46

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand Open-Meteo CLI Vitest e2e coverage

2 participants