Skip to content

Files

Latest commit

7708694 · Nov 27, 2024

History

History

integration-tests

Hardware API Integration Tests

This repository contains integration tests for the hardware-api project, validating the communication between client and server components using sanitized data from certified machines.

Overview

The tests ensure that specific machines remain indentified as certified regardless of changes in the client or server codebase. They use real-world data from certified machines, sanitized for testing purposes.

Prerequisites

  1. Install Docker
  2. Configure Docker permissions

Running the Tests

Execute the test suite using Docker Compose:

docker compose up --build --abort-on-container-exit

Test Architecture

The test suite runs in Docker containers and consists of two main components:

Test Flow:

  1. Server container starts and populates the DB using mocked C3 responses
  2. Client container:
    • Collects hardware information using hwlib
    • Sends requests to the server
    • Compares responses with expected results in response.json files
  3. Tests pass if all responses match their expected values

Test Data:

Contributing

When adding new test machines data:

  1. Add corresponding mock data to the server
  2. Add test data to the client
  3. Create appropriate response.json files
  4. Update tests as needed