Skip to content

Completion of Marketstack API E2E tests

Ticket #221: Completion of Marketstack API E2E tests
Type: Automation / API Testing / Security
Affected Component: e2e/src/tests/marketstackApi.spec.ts, e2e/scripts/save-windows-secrets.ps1, e2e/scripts/run-with-windows-secrets.ps1, e2e/src/utils/requiredEnv.ts, e2e/package.json, .github/workflows/deploy.yml, docs/tests/pipeline.md, docs/fr/tests/pipeline.md, docs/features/chapter3.md, docs/fr/features/chapter3.md


1. Context and objective

This intervention continues the work started in Task 6 - Advanced API tests (Ticket #172). That earlier step established technical API testing capabilities. This new step focused on a concrete target: validating a real business process tied to Marketstack.

The goal of this session was to finalize a suite that is useful in production operations: business-oriented API validation, secure local and CI execution, and documentation aligned with the real state of the repository.


2. Initial problems identified

Before this intervention, validation was incomplete on critical points:

  • no dedicated Marketstack suite validating the core business flow;
  • inconsistent local and CI execution for API key handling;
  • test status pages not fully synchronized with the implemented coverage;
  • operator commands for E2E/API execution spread across documentation.

3. Implemented solutions

The following actions were implemented:

  1. Dedicated Marketstack E2E suite

    • created marketstackApi.spec.ts around business-relevant API calls;
    • added coverage for key incidents (timeout, server error, invalid JSON);
    • added explicit CI failure rules for missing or invalid API keys.
  2. Windows local secret security

    • extended the local DPAPI vault to include MARKETSTACK_API_KEY;
    • added a targeted -Target marketstack update mode;
    • kept runtime-only in-memory injection, with no plaintext storage in the repository.
  3. CI validation aligned with business need

    • added a dedicated GitHub Actions step for Marketstack tests;
    • explicit failure when MARKETSTACK_API_KEY is missing;
    • targeted reproducible execution through test:marketstack:ci.
  4. EN/FR documentation and command alignment

    • activated tc-pipe-api01 and tc-pipe-api02 in pipeline test pages;
    • updated functional rate to 94%;
    • consolidated user-facing E2E/API commands in chapter 3.2.5.

4. Validation and results

Validation confirmed that:

  • critical API scenarios are covered with clear failure signaling;
  • the Marketstack key is not handled in plaintext in the standard workflow;
  • operator documentation reflects the real implementation status.