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

Fix errors in cice.setup script and add travis tests to catch this sooner #406

Merged
merged 2 commits into from
Feb 18, 2020

Conversation

apcraig
Copy link
Contributor

@apcraig apcraig commented Feb 18, 2020

I am first testing if the new travis tests will catch this then I am going to implement the fix.

I verified that the new travis tests would have failed in this case.

I have also fixed the error.

@apcraig apcraig self-assigned this Feb 18, 2020
@apcraig apcraig marked this pull request as ready for review February 18, 2020 02:31
@apcraig
Copy link
Contributor Author

apcraig commented Feb 18, 2020

This is ready to merge. I fixed the error and also added some tests to travis to check that cice.setup --case and cice.setup --test complete successfully (but I don't build or run those case, it's just a scripts check). I also verified that travis would have failed with the new tests.

Since this is critical, I will merge this now. If there are still problems, we can execute another PR later.

Copy link
Member

@phil-blain phil-blain left a comment

Choose a reason for hiding this comment

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

thanks for the quick fix @apcraig !

Comment on lines +392 to +396
else if (-e ${ICE_SCRIPTS}/tests/${tarray}.ts) then
cat ${ICE_SCRIPTS}/tests/${tarray}.ts >> $tsfile
else
echo "${0}: ERROR, cannot find testsuite file ${tarray}, also checked ${ICE_SCRIPTS}/tests/${tarray}.ts"
exit -1
Copy link
Member

Choose a reason for hiding this comment

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

this just simplifies the logic, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct. noticed this as I was debugging.

@@ -422,6 +420,7 @@ set dorun = false
set dosubmit = true
if (\$?SUITE_BUILD) then
set dobuild = "\${SUITE_BUILD}"
endif
Copy link
Member

@phil-blain phil-blain Feb 18, 2020

Choose a reason for hiding this comment

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

so from what I understand and tested this forgotten endif was the cause of the

else: endif not found.

error. I am pretty surprised, since this is inside the heredoc, so it is just some text written to a file, still the shell running cice.setup dies with a syntax error... the mysteries of the C shell!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly. this is pretty shocking. The endif is missing in the job.submit script yet that script never complained. This is exactly what I had been testing all along. Then when we run a non-suite with cice.setup, it failed due to the missing endif in the part of the script that was generating the job.submit suite script. I really cannot believe how this bug was manifested in the end.

Copy link
Contributor

Choose a reason for hiding this comment

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

This kind of weird behavior usually means there's some other bug, doesn't it? Is it possible to step through the script to find out why it hit that block of code? Or is this a "compiler" bug?

Copy link
Member

Choose a reason for hiding this comment

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

I think this weird behavior is due to the peculiarities of the C shell. As far as I know it is not possible to step a shell script...

So yes I think this is could be classified as a bug in the C shell.

@daveh150
Copy link
Contributor

daveh150 commented Feb 18, 2020 via email

@apcraig apcraig deleted the sfix01 branch August 17, 2022 21:00
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.

4 participants