nginx-s3-gateway icon indicating copy to clipboard operation
nginx-s3-gateway copied to clipboard

[WIP] Move Integration Tests to NodeJS

Open 4141done opened this issue 1 year ago • 1 comments

[!NOTE]
This PR is a work in progress but feedback on direction is welcome.

What

This PR moves the existing integration test suite into a Jest + Superagent-based suite. The goal is to mostly replicate the behavior of the current test suite while also accounting for the large number of potential configurations for the project.

Details

Organization

  1. A basic test set handling encoding, basic usage, etc.
  2. Use-case based tests handling (subject to change)
    1. File/directory browsing
    2. Caching specific
    3. Single page application/asset server
    4. object path acrobatics

Design

The basic execution flow for each test will be:

  1. Ensure a clean state in Minio
  2. Create a bucket using the Minio Client
  3. Write the required test files to the bucket
  4. Build and start an s3-gateway container using the supplied settings for the scenario
  5. Use supertest to send and verify requests against the running container.
  6. Clean up the Minio bucket.

The principles we will try to follow are:

  • Test file structure specific to each use-case based test suite
  • Starting a general transition to thinking about use cases rather than individual config (although that will always be an option)
  • Decoupling general container build from integration test run

4141done avatar Dec 19 '23 16:12 4141done

I would do an explicit call out for the need to install node and/or npm modules.

dekobon avatar Jan 12 '24 18:01 dekobon