Skip to content

Latest commit

 

History

History
147 lines (117 loc) · 4.27 KB

File metadata and controls

147 lines (117 loc) · 4.27 KB

E2E Testing Implementation Summary

Changes Made

1. Docker Infrastructure

Created Files:

  • docker/docker-compose.e2e.yml - Docker Compose configuration for e2e environment
  • docker/e2e/dmsg-server.json - DMSG server configuration with fixed keys
  • docker/images/dmsg-client/Dockerfile - Client container with dmsg utilities and test server
  • .dockerignore - Docker build optimization

Services:

  • Redis (172.20.0.2:6379) - Discovery backend
  • DMSG Discovery (172.20.0.3:9090) - Running in test mode
  • DMSG Server (172.20.0.4:8080) - Routing server
  • DMSG Client (172.20.0.5) - Test container with utilities

2. E2E Test Suite

Created Files:

  • internal/e2e/e2e_test.go - Main test suite with 6 test cases
  • internal/e2e/testserver/main.go - Simple HTTP server for testing
  • internal/e2e/README.md - E2E tests documentation

Test Cases:

  1. TestDiscoveryIsRunning - Verify discovery service is running
  2. TestDmsgServerIsRunning - Verify dmsg server is running
  3. TestDmsgCurlBasic - Test dmsg curl functionality end-to-end
  4. TestDmsgWebProxy - Test dmsg web SOCKS5 proxy startup
  5. TestVersionFieldPresent - CRITICAL regression test for version field bug
  6. TestDmsgCurlToDiscovery - Test querying discovery API

3. Build and Automation

Created Files:

  • scripts/run-e2e-tests.sh - Automated test runner script
  • E2E_TESTING.md - Comprehensive documentation

Modified Files:

  • Makefile - Added test-e2e target and updated .PHONY

4. Documentation

Created Files:

  • E2E_TESTING.md - Complete guide to e2e testing framework
  • internal/e2e/README.md - Quick reference for test developers

Key Features

Regression Test for Version Field Bug

The most important test is TestVersionFieldPresent, which validates the fix from commit caca20b5. This test:

  • Executes dmsg curl -Z (HTTP discovery mode)
  • Would fail with "entry validation error: entry has no version" before the fix
  • Ensures Entry structs in multiple files include the required version field
  • Prevents regression of this critical bug

Architecture Similar to Skywire

Following the skywire e2e test pattern:

  • Docker-based isolated environment
  • Local deployment (not production services)
  • Tests client applications using the protocol
  • CI-ready with build tags

Complete Test Coverage

Tests cover the main dmsg client utilities:

  • dmsg curl - Downloads over DMSG
  • dmsg web - SOCKS5 proxy
  • dmsg web srv - HTTP over DMSG server

Usage

Run Tests Locally

cd ../dmsg
make test-e2e

Or manually:

./scripts/run-e2e-tests.sh

Run in CI

cd dmsg
./scripts/run-e2e-tests.sh

The tests are tagged with !no_ci and will be included in CI builds.

Files Created

dmsg/
├── docker/
│   ├── docker-compose.e2e.yml          # E2E environment definition
│   ├── e2e/
│   │   └── dmsg-server.json            # Server config
│   └── images/
│       └── dmsg-client/
│           └── Dockerfile              # Client container image
├── internal/
│   └── e2e/
│       ├── e2e_test.go                 # Test suite
│       ├── README.md                   # Quick reference
│       └── testserver/
│           └── main.go                 # HTTP test server
├── scripts/
│   └── run-e2e-tests.sh                # Test runner
├── E2E_TESTING.md                      # Full documentation
├── .dockerignore                       # Docker build optimization
└── Makefile                            # Added test-e2e target

Next Steps

To verify the implementation:

  1. Build the Docker images:

    cd docker
    docker-compose -f docker-compose.e2e.yml build
  2. Run the tests:

    cd ..
    make test-e2e
  3. If needed, debug with:

    cd docker
    docker-compose -f docker-compose.e2e.yml up
    # In another terminal:
    go test -v -tags !no_ci ./internal/e2e/...

Impact

This e2e testing framework will:

  • Catch bugs like the recent version field issue automatically
  • Provide confidence in dmsg client utilities functionality
  • Enable safer refactoring and feature development
  • Match the quality standards set by skywire's testing
  • Support CI/CD automation