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

Enforced exit code 0 in prestart.sh #26

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

mikaelhm
Copy link
Contributor

@mikaelhm mikaelhm commented Nov 13, 2023

This PR will fix the problem below, by ensuring that prestart.sh return a zero exit code on successful completion.

Problem:

prestart.sh will attempt to run test_collection/<collection_name>/prestart.sh if that script exists.

This is done by:

# Run Prestart scripts in test collections
for dir in ./test_collections/*
do
    prestart=$dir/prestart.sh
    # Only run prestart.sh if present/
    [ -x $prestart ] && $prestart
done

However, if the script doesn't exist. [ -x $prestart ] will return a non-zero value.
As this is the last step in prestart.sh the exit code of prestart.sh will be the non-zero value if the last iteration in the for-loop is for a test_collection that doesn't have a prestart script.

This will stop the start.sh to not start the gunicorn server.

@mikaelhm mikaelhm merged commit 8a6c952 into project-chip:main Nov 13, 2023
7 checks passed
@mikaelhm mikaelhm deleted the fix/prestart-exit branch November 13, 2023 18:37
@mikaelhm mikaelhm restored the fix/prestart-exit branch November 13, 2023 19:51
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