Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup all shell scripts #128

Merged
merged 1 commit into from
Sep 12, 2017
Merged

cleanup all shell scripts #128

merged 1 commit into from
Sep 12, 2017

Conversation

balamurugana
Copy link
Member

No description provided.

@nitisht
Copy link
Contributor

nitisht commented Sep 7, 2017

looks like ShellCheck is failing @balamurugana can you please fix.

@nitisht nitisht requested a review from poornas September 7, 2017 02:22
# limitations under the License.
#

MINIO_GO_VERSION="v3.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest go version is 3.0.2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This directory serves as the location for Mint tests using `aws-sdk-php`. Top level `tests.sh` calls `run.sh` to execute tests.

## Adding new tests
New tests is added into `quick-tests.php` like as new functions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tests is added into quick-tests.php like as new functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

preinstall.sh Outdated
$APT install $(cat install-packages.list)

# set python 3.5 as default
update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python 3.6.2 is latest stable version - should we change version here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. python is used whatever is provided by default by ubuntu 16.04

mint.sh Outdated
mkdir -p "$BASE_LOG_DIR/$sdk_name"

(cd "$BASE_LOG_DIR/$sdk_name"; ./run.sh "$BASE_LOG_DIR/$sdk_name/$OUTPUT_LOG_FILE" "$BASE_LOG_DIR/$sdk_name/$ERROR_LOG_FILE")
rv=$?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/rv/rc/ - more idiomatic.

mint.sh Outdated
function main()
{
## $MINT_MODE is used inside every sdks.
echo "To get intermittent logs, 'sudo docker cp ${CONTAINER_ID}:/mint/log /tmp/mint-logs'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what intermittent means in this context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could fetch logs when tests are in progress/running

mint.sh Outdated

CONTAINER_ID=$(awk -F / '{ print substr($NF, 1, 12) }' /proc/1/cpuset)
MINT_DATA_DIR=${MINT_DATA_DIR:-/mint/data}
MINT_MODE=${MINT_MODE:-core}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need MINT_MODE defined here -minio-go functional tests use MODE=quick, dotnet defines MINT_MODE=quick in latest PR. We need to standardize on the env variable so that SDK's can distinguish between quick tests and verbose tests. Each SDK's Readme.md in the mint run/core/... dir also needs a update.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix in a separate PR dealing with mint modes

@balamurugana balamurugana changed the title Simply all run scripts cleanup all shell scripts Sep 7, 2017
@balamurugana
Copy link
Member Author

@nitisht fixed shellcheck errors. However shellcheck errors shown now are not errors.

Copy link
Contributor

@nitisht nitisht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, if a specific SDK tests fails, say minio-go fails, mint stops execution of minio-go tests, moves to the next SDK and starts the tests.

Wanted to clarify if that is the expected behaviour or mint should stop the execution completely on first failure and exit?

@@ -0,0 +1,17 @@
## `aws-sdk-php` tests
This directory serves as the location for Mint tests using `aws-sdk-php`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh calls tests.sh to execute tests.

@@ -0,0 +1,17 @@
## `aws-sdk-ruby` tests
This directory serves as the location for Mint tests using `aws-sdk-ruby`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh calls aws-stub-tests.rb to execute tests.

## `awscli` tests.
This directory serves as the location for Mint tests using `awscli`. To add new test case to Mint `awscli` app, just add new method in the `test.sh` file.
## `awscli` tests
This directory serves as the location for Mint tests using `awscli`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh calls tests.sh to execute tests.

## `mc` tests.
This directory serves as the location for Mint tests using `mc`. To add new test case to Mint `mc` app, just add new method in the `test.sh` file.
## `mc` tests
This directory serves as the location for Mint tests using `mc`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh calls tests.sh to execute tests.

@@ -0,0 +1,17 @@
## `minio-java` tests
This directory serves as the location for Mint tests using `minio-java`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh executes Java tests.

@@ -0,0 +1,17 @@
## `minio-js` tests
This directory serves as the location for Mint tests using `minio-js`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh executes minio-js tests.

@@ -0,0 +1,17 @@
## `minio-py` tests
This directory serves as the location for Mint tests using `minio-py`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh executes minio-py tests.

@@ -0,0 +1,17 @@
## `minio-go` tests
This directory serves as the location for Mint tests using `minio-go`. Top level `tests.sh` calls `run.sh` to execute tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level run.sh executes minio-go tests.

@nitisht
Copy link
Contributor

nitisht commented Sep 8, 2017

However shellcheck errors shown now are not errors.

Agreed, but we need to follow one style and the linter shellcheck enforces that. We can look at other better linter options if available. Travis still fails.

@harshavardhana
Copy link
Member

@nitisht fixed shellcheck errors. However shellcheck errors shown now are not errors.

@balamurugana there is a reasoning behind such a requested change - https://github.com/koalaman/shellcheck/wiki/SC2046

@poornas
Copy link
Contributor

poornas commented Sep 8, 2017

@balamurugana , ran the Dockerfile and Dockerfile.dev - a few more issues:

  • pressing Ctrl-C would cancel the run earlier but no longer works. Needs to be resuscitated.
  • minio-js fails with Dockerfile.dev but not Dockerfile
1) functional tests tests for putObject copyObject getObject getPartialObject statObject removeObject should download 100KB string upload and match content:
     Error: content mismatch
      at IncomingMessage.stream.on (test/functional-tests.js:258:16)
      at endReadableNT (_stream_readable.js:974:12)
      at _combinedTickCallback (internal/process/next_tick.js:80:11)
      at process._tickCallback (internal/process/next_tick.js:104:9)

  2) functional tests tests for putObject copyObject getObject getPartialObject statObject removeObject should download partial data (100kb of the 6mb file) and match content:
     Error: content mismatch
      at IncomingMessage.stream.on (test/functional-tests.js:313:16)
      at endReadableNT (_stream_readable.js:974:12)
      at _combinedTickCallback (internal/process/next_tick.js:80:11)
      at process._tickCallback (internal/process/next_tick.js:104:9)

@poornas
Copy link
Contributor

poornas commented Sep 8, 2017

might be a good idea to log the sdk version as well in the output/error log.

@balamurugana
Copy link
Member Author

All shellcheck errors and comments are addressed

@balamurugana
Copy link
Member Author

@nitisht

Currently, if a specific SDK tests fails, say minio-go fails, mint stops execution of minio-go tests, moves to the next SDK and starts the tests.

Wanted to clarify if that is the expected behaviour or mint should stop the execution completely on first failure and exit?

This is the current (and correct) behavior.

@poornas

pressing Ctrl-C would cancel the run earlier but no longer works. Needs to be resuscitated.

done

minio-js fails with Dockerfile.dev but not Dockerfile

  • Test failures need to be addressed separately in respective SDKs.
  • Dockerfile should fail as it clones mint and runs release.sh where release.sh is not available (until this PR merges)

@balamurugana
Copy link
Member Author

travis failure SC2064: Use single quotes, otherwise this expands now rather than when signalled. is not an error. expansion should not occur later.

Copy link
Contributor

@nitisht nitisht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than one typo

- A normal response should be redirected to `$AWSCLI_LOG_FILE`, and error response should be redirected to `$AWSCLI_ERROR_LOG_FILE`.
- Do not proceed to next testcase in case of an error.
## Adding new tests
New tests is added into `mint.sh` as new functions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tests is added into test.sh as new functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

This patch does below
* cleans up all shell scripts
* provides package installation separately
* provides way to run tests in non-docker enviroment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants