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

Add script to compile, build, run, call API and test response [ci skip] #5737

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Mar 7, 2024

Summary

When searching for bugs it is sometimes useful to eliminate commits, and or comment out code and perform a test to verify if the bug is precent or not. Git provide a handy tool for doing a binary search in commits, the git bisect command. This PR add a script which automate the pocess of verifying if a bug is present or not.

For more information look at the --help section in the script.

This PR also add a README file and some guidelines for scripts.

Issue

🟥 No issue. This is just tooling for developers.

Unit tests

🟥 The script have no tests.

Documentation

✅ Script Readme.md and Script usage.

Changelog

🟥 This is not relevant for product owners

Bumping the serialization version id

🟥 OTP Source code not changed

@t2gran t2gran added this to the 2.5 (next release) milestone Mar 7, 2024
@t2gran t2gran requested a review from a team as a code owner March 7, 2024 17:56
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.78%. Comparing base (58ba141) to head (4ce0cdd).
Report is 20 commits behind head on dev-2.x.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #5737   +/-   ##
==========================================
  Coverage      67.77%   67.78%           
- Complexity     16475    16479    +4     
==========================================
  Files           1901     1901           
  Lines          72121    72132   +11     
  Branches        7430     7430           
==========================================
+ Hits           48882    48893   +11     
+ Misses         20727    20726    -1     
- Partials        2512     2513    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

script/run-and-test-otp Outdated Show resolved Hide resolved
@leonardehrenfried leonardehrenfried changed the title Add srcipt to compile, build, run, call API and test response Add script to compile, build, run, call API and test response Mar 9, 2024
@leonardehrenfried leonardehrenfried self-requested a review March 12, 2024 10:50
@leonardehrenfried leonardehrenfried changed the title Add script to compile, build, run, call API and test response Add script to compile, build, run, call API and test response [ci skip] Mar 12, 2024
script/Readme.md Outdated Show resolved Hide resolved
script/run-and-test-otp Outdated Show resolved Hide resolved

echo "Start OTP, output: $OTP_LOG"
mv target/otp-*-shaded.jar target/otp-shaded.jar
java -Xmx16G -jar target/otp-shaded.jar ${DATA_DIR} --build --save --serve > ${OTP_LOG} &
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be possible to use | tee "${OTP_LOG}" instead of redirection to file, keep the console output and skip the tail process below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if it will work, I need the the java PID (see line 68) to terminate the java process later, so if we use tee then I think we get the tee PID instead. I tried something like it, but it did not work. Not sure if I did the exact same thing as you suggested.

Copy link
Contributor

Choose a reason for hiding this comment

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

In practice it doesn't matter that much: even if it's the tee pid that is killed, the whole pipe is still terminated.

while true ; do sleep 1 ; date ; done | tee /tmp/log.txt & ; PID=$! ; echo "PID: $PID\n" ; sleep 4 ; ps aux | grep $PID ; kill $PID

Nevermind, it doesn't matter. 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

Good tip, I didn't know that. I will leave it as is for now. Do not want to spend more time on it.

@t2gran t2gran requested a review from jtorin March 12, 2024 12:52
script/Readme.md Outdated Show resolved Hide resolved
Co-authored-by: Leonard Ehrenfried <[email protected]>
@t2gran t2gran modified the milestones: 2.5, 2.6 (next release) Mar 13, 2024
@t2gran t2gran merged commit 8ef9f56 into opentripplanner:dev-2.x Mar 19, 2024
5 checks passed
@t2gran t2gran deleted the scripts branch March 19, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants