Giter VIP home page Giter VIP logo

mint's Introduction

Mint Slack Docker Pulls

Mint is a testing framework for Minio object server, available as a podman image. It runs correctness, benchmarking and stress tests. Following are the SDKs/tools used in correctness tests.

  • awscli
  • aws-sdk-go
  • aws-sdk-java
  • aws-sdk-java-v2
  • aws-sdk-php
  • aws-sdk-ruby
  • healthcheck
  • mc
  • minio-go
  • minio-java
  • minio-js
  • minio-py
  • s3cmd
  • s3select
  • versioning

Running Mint

Mint is run by podman run command which requires Podman to be installed. For Podman installation follow the steps here.

To run Mint with Minio Play server as test target,

$ podman run -e SERVER_ENDPOINT=play.minio.io:9000 -e ACCESS_KEY=Q3AM3UQ867SPQQA43P2F \
             -e SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG -e ENABLE_HTTPS=1 minio/mint

After the tests are run, output is stored in /mint/log directory inside the container. To get these logs, use podman cp command. For example

podman cp <container-id>:/mint/log /tmp/logs

Mint environment variables

Below environment variables are required to be passed to the podman container. Supported environment variables:

Environment variable Description Example
SERVER_ENDPOINT Endpoint of Minio server in the format HOST:PORT; for virtual style IP:PORT play.minio.io:9000
ACCESS_KEY Access key for SERVER_ENDPOINT credentials Q3AM3UQ867SPQQA43P2F
SECRET_KEY Secret Key for SERVER_ENDPOINT credentials zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
ENABLE_HTTPS (Optional) Set 1 to indicate to use HTTPS to access SERVER_ENDPOINT. Defaults to 0 (HTTP) 1
MINT_MODE (Optional) Set mode indicating what category of tests to be run by values core, full. Defaults to core full
DOMAIN (Optional) Value of MINIO_DOMAIN environment variable used in Minio server myminio.com
ENABLE_VIRTUAL_STYLE (Optional) Set 1 to indicate virtual style access . Defaults to 0 (Path style) 1
RUN_ON_FAIL (Optional) Set 1 to indicate execute all tests independent of failures (currently implemented for minio-go and minio-java) . Defaults to 0 1
SERVER_REGION (Optional) Set custom region for region specific tests us-west-1

Test virtual style access against Minio server

To test Minio server virtual style access with Mint, follow these steps:

  • Set a domain in your Minio server using environment variable MINIO_DOMAIN. For example export MINIO_DOMAIN=myminio.com.
  • Start Minio server.
  • Execute Mint against Minio server (with MINIO_DOMAIN set to myminio.com) using this command
$ podman run -e "SERVER_ENDPOINT=192.168.86.133:9000" -e "DOMAIN=minio.com"  \
	     -e "ACCESS_KEY=minio" -e "SECRET_KEY=minio123" -e "ENABLE_HTTPS=0" \
	     -e "ENABLE_VIRTUAL_STYLE=1" minio/mint

Mint log format

All test logs are stored in /mint/log/log.json as multiple JSON document. Below is the JSON format for every entry in the log file.

JSON field Type Description Example
name string Testing tool/SDK name "aws-sdk-php"
function string Test function name "getBucketLocation ( array $params = [] )"
args object (Optional) Key/Value map of arguments passed to test function {"Bucket":"aws-sdk-php-bucket-20341"}
duration int Time taken in milliseconds to run the test 384
status string one of PASS, FAIL or NA "PASS"
alert string (Optional) Alert message indicating test failure "I/O error on create file"
message string (Optional) Any log message "validating checksum of downloaded object"
error string Detailed error message including stack trace on status FAIL "Error executing \"CompleteMultipartUpload\" on ...

For Developers

Running Mint development code

After making changes to Mint source code a local podman image can be built/run by

$ podman build -t minio/mint . -f Dockerfile
$ podman run -e SERVER_ENDPOINT=play.minio.io:9000 -e ACCESS_KEY=Q3AM3UQ867SPQQA43P2F \
             -e SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG \
             -e ENABLE_HTTPS=1 -e MINT_MODE=full minio/mint:latest

Adding tests with new tool/SDK

Below are the steps need to be followed

  • Create new app directory under build and run/core directories.
  • Create install.sh which does installation of required tool/SDK under app directory.
  • Any build and install time dependencies should be added to install-packages.list.
  • Build time dependencies should be added to remove-packages.list for removal to have clean Mint podman image.
  • Add run.sh in app directory under run/core which execute actual tests.

Test data

Tests may use pre-created data set to perform various object operations on Minio server. Below data files are available under /mint/data directory.

File name Size
datafile-0-b 0B
datafile-1-b 1B
datafile-1-kB 1KiB
datafile-10-kB 10KiB
datafile-33-kB 33KiB
datafile-100-kB 100KiB
datafile-1-MB 1MiB
datafile-1.03-MB 1.03MiB
datafile-5-MB 5MiB
datafile-6-MB 6MiB
datafile-10-MB 10MiB
datafile-11-MB 11MiB
datafile-65-MB 65MiB
datafile-129-MB 129MiB

Updating SDKs/binaries in the image

In many cases, updating the SDKs or binaries in the image is just a matter of making a commit updating the corresponding version in this repo. However, in some cases, e.g. when mc needs to be updated (the latest mc is pulled in during each mint image build), a sort of "dummy" commit is required as an image rebuild must be triggered. Note that an empty commit does not appear to trigger the image rebuild in the Docker Hub.

mint's People

Contributors

angristan avatar balamurugana avatar bigustad avatar dependabot[bot] avatar donatello avatar ebozduman avatar flysnoworg avatar halkyon avatar harshavardhana avatar iternity-dotcom avatar kanagarajkm avatar kannappanr avatar klauspost avatar mclarkson avatar muesli avatar nesty92 avatar nitisht avatar poornas avatar prakashsvmx avatar praveenrajmani avatar shtripat avatar srujandeshpande avatar trim21 avatar trinity-1686a avatar vadmeste avatar vinozzz avatar vsadineni1 avatar yaozongyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mint's Issues

Add Debug category tests

Add Debug category of tests which uses facilities like Minio admin API's to give preliminary information about the system and the Minio deployment before we start to debug.

Add test cases for aws-cli

Add correctness test cases based on aws-cli to Mint.

Tests should

  • Access all the public Minio server APIs via aws-cli.
  • Include one positive case and couple of boundary cases for each API.
  • Have minimum file size uploads required to test multipart uploads.
  • Refer test files from a static data directory as in (https://github.com/minio/minio-go/pull/727/files#diff-81a03de42b955e14be71afa81768a78cR52). This helps keep the Mint container light weight and avoids the file creation in runtime, making the tests run faster.

Tests should not include

  • Big file uploads.
  • Multiple tests related to the same API.

Proposal: Accelerating building mint dev docker images

It is very slow to build a Mint docker image to check if everything is okay. We do a lot of iterations of writing code and testing, so this slowness is bad for us.

Why building the image is slow? The reason is that our docker script does a lot of tasks to download and install all dependencies. Since it is generally considered better to include the least possible number of RUN commands in a docker file, I suggest to make an exception for Dockerfile.dev.

In Dockerfile.dev, we can call RUN only twice:
*) The first RUN will init, download and install all dependencies.
*) The second RUN will copy our tests code.

Dockerfile and Dockerfile.dev should be similar, the only difference is that RUN in Dockerfile will be splitted into two RUNs in Dockerfile.dev

Add additional ruby tests in mint

Add correctness test cases based on aws-ruby to Mint. Tests should be

  • Named and commented to indicate the use case being tested.
  • Access all the public Minio server APIs via aws-ruby.
  • Include one positive case and couple of boundary cases for each API.
  • Use streaming files as preferred way to generate files for testing. (This can be a ref: minio/minio-java#586)
  • Use static files only in case where streaming can't be used.

Remove all the references of old data files

$ git grep FileOfSize
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSize65MB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSize65MB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSizeGt1MB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSizeGt32KB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSize128mb")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSize65MB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSize65MB")
run/core/minio-go/minio-go-tests.go:    fName := getFilePath("FileOfSize65MB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSizeGt32KB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSizeGt32KB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSizeGt32KB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSizeGt32KB")
run/core/minio-go/minio-go-tests.go:    fileName := getFilePath("FileOfSize100KB")
run/core/minio-java/FunctionalTest.java:  private static String FileOfSize1b=dataDir + "/FileOfSize1B";
run/core/minio-java/FunctionalTest.java:  private static String FileOfSize6mb=dataDir + "/FileOfSize6MB";
run/core/minio-java/FunctionalTest.java:  private static String smallFile=dataDir + "/FileOfSize1MB";
run/core/minio-java/FunctionalTest.java:  private static String largeFile=dataDir + "/FileOfSize11MB";
run/core/minio-java/FunctionalTest.java:      client.putObject(bucketName, objectNames[i],FileOfSize1b);
run/core/minio-java/FunctionalTest.java:    InputStream is = Files.newInputStream(Paths.get(FileOfSize6mb));
run/core/minio-java/FunctionalTest.java:    InputStream is = Files.newInputStream(Paths.get(FileOfSize6mb));
run/core/minio-java/FunctionalTest.java:    InputStream is = Files.newInputStream(Paths.get(FileOfSize6mb));
run/core/minio-java/FunctionalTest.java:    InputStream is = Files.newInputStream(Paths.get(FileOfSize6mb));
run/core/minio-js/test/functional-tests.js:    var _100kb = fs.readFileSync(dataDir + "/FileOfSize100KB")
run/core/minio-js/test/functional-tests.js:    var _11mb = fs.readFileSync(dataDir + "/FileOfSize11MB")
run/core/minio-js/test/functional-tests.js:    var _5mb = fs.readFileSync(dataDir + "/FileOfSize5MB")
run/core/minio-py/functional_test.py:    largefile = data_dir + "/" + "FileOfSize6MB"
run/core/minio-py/functional_test.py:    testfile = data_dir + "/" + "FileOfSize100KB"
run/core/minio-py/functional_test.py:    largefile = data_dir + "/" + "FileOfSize6MB"

Without these changes minio-go, minio-java, minio-js and minio-py won't run.

mint shouldn't change permissions of files

Steps to reproduce:

docker run -e S3_ADDRESS=172.18.0.1:9000 -e ACCESS_KEY=minio -e SECRET_KEY=minio123 minio/mint:alpha

Current behaviour:

The following files' permissions are changed.

	modified:   build.sh
	modified:   run.sh
	modified:   ../sdk-tests/build.sh
	modified:   ../sdk-tests/run.sh

Expected behaviour:

Permissions of file in repo shouldn't change.

Add client library examples.

Add client library example codes from minio-java, minio-py, minio-go, minio-js to functional tests category in Mint.

Automate Mint execution on M2 server

  • Pull the Minio server master branch code from GitHub
  • Build Minio server, deploy on local server in FS and Erasure mode.
  • Run Mint against both the Minio server instances.
  • Output logs to a time stamped directory, so web app can pick from the location.

docker build: Mint docker build stuck

Command to build mint docker image: docker build -t minio/mint:alpha . is stuck

Sending build context to Docker daemon 494.1 kB
Step 1/5 : FROM golang:1.7-alpine
 ---> ad5b584cc9b4
Step 2/5 : COPY . /home
 ---> Using cache
 ---> 90deb1576e2c
Step 3/5 : WORKDIR /home
 ---> Using cache
 ---> d016e95e2a92
Step 4/5 : RUN apk add --no-cache bash git openssh mailcap &&        go get -u github.com/minio/minio-go &&        chmod +x run.sh
 ---> Running in abb3d982e183
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/14) Installing ncurses-terminfo-base (6.0-r7)
(2/14) Installing ncurses-terminfo (6.0-r7)
(3/14) Installing ncurses-libs (6.0-r7)
(4/14) Installing readline (6.3.008-r4)
(5/14) Installing bash (4.3.42-r5)
Executing bash-4.3.42-r5.post-install
(6/14) Installing libssh2 (1.7.0-r0)
(7/14) Installing libcurl (7.52.1-r2)
(8/14) Installing expat (2.2.0-r0)
(9/14) Installing pcre (8.38-r1)
(10/14) Installing git (2.8.5-r0)
(11/14) Installing mailcap (2.1.44-r0)
(12/14) Installing openssh-client (7.2_p2-r4)
(13/14) Installing openssh-sftp-server (7.2_p2-r4)
(14/14) Installing openssh (7.2_p2-r4)
Executing busybox-1.24.2-r13.trigger
OK: 37 MiB in 26 packages

There is no confirmation if the build is completed or not.

Add concurrent tests.

Add concurrent tests to be able to catch potential race conditions in the code. The Minio binary has to be built with -race before running this test on the server.

Add test cases for aws-java

Add correctness test cases based on aws-java to Mint. Same test from minio-java, but use aws-java-sdk instead.

Add test cases for mc

Add correctness test cases based on mc to Mint.

Tests should

  • Access all the public Minio server APIs via mc.
  • Include one positive case and couple of boundary cases for each API.
  • Have minimum file size uploads required to test multipart uploads.
  • Refer test files from a static data directory as in (https://github.com/minio/minio-go/pull/727/files#diff-81a03de42b955e14be71afa81768a78cR52). This helps keep the Mint container light weight and avoids the file creation in runtime, making the tests run faster.

Tests should not include

  • Big file uploads.
  • Multiple tests related to the same API.

Improve Initialization.

Need to check whether the remote Minio server under test is reachable during the initialization.

Add test cases for minio-py sdk

Mint pulls functional test cases from minio-py sdk.

Minio-Py SDK tests should be updated to address the following

  • Named and commented to indicate the use case being tested.
  • Access all the public Minio server APIs via minio-py.
  • Include one positive case and couple of boundary cases for each API.

Add test cases for aws-php

Add correctness test cases based on aws-php to Mint.

Tests should

  • Access all the public Minio server APIs via aws-php.
  • Include one positive case and couple of boundary cases for each API.
  • Have minimum file size uploads required to test multipart uploads.
    Refer test files from a static data directory as in (https://github.com/minio/minio-go/pull/727/files#diff-81a03de42b955e14be71afa81768a78cR52). This helps keep the Mint container light weight and avoids the file creation in runtime, making the tests run faster.

Tests should not include

  • Big file uploads.
  • Multiple tests related to the same API.

Add verbose option.

Currently the name of all the tests run are being printed on console, it should be done only on enabling the verbose option.

(Re)write test cases for minio-js

Current minio-js has functional tests but we need to take a fresh look at the tests -

Tests should

  • Be named to indicate the use case they are testing.
  • Access all the public Minio server APIs via minio-js.
  • Include one positive case and couple of boundary cases for each API.
  • Have minimum file size uploads required to test multipart uploads.
  • Refer test files from a static data directory as in (https://github.com/minio/minio-go/pull/727/files#diff-81a03de42b955e14be71afa81768a78cR52). This helps keep the Mint container light weight and avoids the file creation in runtime, making the tests run faster.

Tests should not include

  • Big file uploads.
  • Multiple tests related to the same API.

aws-sdk-ruby fails with recent MINT_DATA_DIR change

aws-stub-tests.rb:150: formal argument cannot be a constant
  def upload_object_test(s3Resource, MINT_DATA_DIR)
                                                  ^
aws-stub-tests.rb:177: formal argument cannot be a constant
  def download_object_test(s3Resource,MINT_DATA_DIR)
                                                   ^
docker pull play.minio.io/mint:travis-49de03e76be957d7807cc673734dab49538c8fa3

Update Mint for release readiness

  • mc + minio sdks + aws java + aws cli + aws php sdk run these in mint.
  • Focus on correctness
  • run this on minio server, minio gateway modes.

(Re)Write test cases for minio-java

Current minio-java has functional tests but we need to take a fresh look at the tests -

Tests should

  • Complete fast. No stress tests.
  • Be named to indicate the use case they are testing.
  • Access all the public Minio server APIs via minio-java.
  • Include positive case and edge cases for each API.
  • Refer test files from a static data directory as in (https://github.com/minio/minio-go/pull/727/files#diff-81a03de42b955e14be71afa81768a78cR52). This helps keep the Mint container light weight and avoids the file creation in runtime, making the tests run faster.

Tests should not include

  • Big file uploads.
  • Multiple tests related to the same API.

Add test cases for aws-ruby

Add correctness test cases based on aws-ruby to Mint.

Tests should

  • Access all the public Minio server APIs via aws-ruby.
  • Include one positive case and couple of boundary cases for each API.
  • Have minimum file size uploads required to test multipart uploads.
  • Refer test files from a static data directory as in (https://github.com/minio/minio-go/pull/727/files#diff-81a03de42b955e14be71afa81768a78cR52). This helps keep the Mint container light weight and avoids the file creation in runtime, making the tests run faster.

Tests should not include

  • Big file uploads.
  • Multiple tests related to the same API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.