Files
versitygw/tests
..
2024-02-07 14:58:06 -03:00

Command-Line Tests

Instructions - Running Locally

  1. Build the versitygw binary.
  2. Install the aws command-line interface if unavailable on your machine. Instructions are here.
  3. Install BATS. Instructions are here.
  4. Create a .secrets file in the tests folder, and add the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY values to the file.
  5. Create a local AWS profile for connection to S3, and add the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION values for your account to the profile. Example:
    export AWS_PROFILE=versity-test
    export AWS_ACCESS_KEY_ID=<your account ID>
    export AWS_SECRET_ACCESS_KEY=<your account key>
    export AWS_REGION=<your account region>
    aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile $AWS_PROFILE
    aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile $AWS_PROFILE
    aws configure set aws_region $AWS_REGION --profile $AWS_PROFILE
  1. Create an environment file (.env) similar to the ones in this folder, setting the AWS_PROFILE parameter to the name of the profile you created.
  2. In the root repo folder, run with VERSITYGW_TEST_ENV=<env file> tests/run_all.sh.

Instructions - Running With Docker

  1. Create a .secrets file in the tests folder, and add the AWS_PROFILE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and the AWS_PROFILE fields.
  2. Build and run the Dockerfile_test_bats file.