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

feat: add script for spring #49

Merged
merged 2 commits into from
Jan 20, 2022
Merged

feat: add script for spring #49

merged 2 commits into from
Jan 20, 2022

Conversation

genryxy
Copy link
Contributor

@genryxy genryxy commented Jan 20, 2022

Part of #47
Added script for running jmx for Spring Boot locally.

@genryxy genryxy requested review from a team and olenagerasimova and removed request for a team January 20, 2022 10:21
Copy link
Member

@olenagerasimova olenagerasimova left a comment

Choose a reason for hiding this comment

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

@genryxy thanks

@genryxy genryxy requested a review from g4s8 January 20, 2022 11:43
@genryxy
Copy link
Contributor Author

genryxy commented Jan 20, 2022

@g4s8 could you please check

Copy link
Member

@g4s8 g4s8 left a comment

Choose a reason for hiding this comment

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

@genryxy please check my comments

@@ -0,0 +1,12 @@
#!/bin/sh
Copy link
Member

Choose a reason for hiding this comment

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

Why not bash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know exactly the difference between bash and sh, but as I understand bash is more featured sh therefore it would be better to use bash here

@@ -0,0 +1,12 @@
#!/bin/sh
# Run performance tests for Spring Boot server locally

Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest adding set -eo pipefail for any script:

  • -e for "Exit immediately if a command exits with a non-zero status."
  • -o pipefail for "the return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status"

@@ -0,0 +1,12 @@
#!/bin/sh
# Run performance tests for Spring Boot server locally

Copy link
Member

Choose a reason for hiding this comment

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

Since you use relative paths here, I'd add cd ${0%/*} as first command to cd into script directory

rm -rf spring-upload-res
rm spring-upload.log

mkdir -p spring-upload-res
Copy link
Member

Choose a reason for hiding this comment

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

Why -p is needed here? You are removing this directory with previous command


echo "Run jmeter tests"
"PATH_TO_JMETER" jmeter -n -t ../files/upload-files.jmx -l spring-upload.log -e -o ./spring-upload-res -Jrepository.host=localhost -Jrepository.port=8080
sleep 10
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of sleep?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, it was for debug purpose

@@ -0,0 +1,7 @@
#!/bin/sh
Copy link
Member

Choose a reason for hiding this comment

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

Previous comments could be applied here too


mvn clean install
mvn dependency:copy-dependencies
rm rf spring.log
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rm rf spring.log
rm -f spring.log

@genryxy
Copy link
Contributor Author

genryxy commented Jan 20, 2022

@g4s8 thanks, all corrected

Copy link
Member

@g4s8 g4s8 left a comment

Choose a reason for hiding this comment

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

@genryxy thanks

@g4s8 g4s8 merged commit 9bf2a2a into artipie:master Jan 20, 2022
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.

3 participants