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

Save and return exit status at END #404

Merged
merged 1 commit into from
Jan 9, 2023
Merged

Save and return exit status at END #404

merged 1 commit into from
Jan 9, 2023

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Jan 9, 2023

Description

Save and regurgitate exit status at END

Fixes ska_testr run test which was implicitly checking exit status.

Interface impacts

Testing

Unit tests

  • No unit tests

Functional tests

I confirmed that the "nominal exit" code is now 0 instead of 9 and that simple errors for missing or not existing directories for products give non-zero status:

Using bad_pixel file /proj/sot/ska/jeanproj/git/starcheck/starcheck/data/ACABadPixels
Using acq_star_rdb file /proj/sot/ska/jeanproj/git/starcheck/starcheck/data/bad_acq_stars.rdb
Using gui_star_rdb file /proj/sot/ska/jeanproj/git/starcheck/starcheck/data/bad_gui_stars.rdb
Reading backstop file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/CR140_0101.backstop
Reading DOT file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/mps/mdMAY2019A.dot
Reading TLR file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/CR140_0101.tlr
Reading MM file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/mps/mmMAY2019A.sum
Reading process summary /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/mps/msMAY2019A.sum
Reading mech check file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/output/TEST_mechcheck.txt
Reading OR file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/mps/or/MAY2019_A.or
Reading FIDSEL file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/History/FIDSEL.txt
Reading Maneuver Error file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/output/MAY2019A_ManErr.txt
Getting dither state from kadi at 2019:140:00:57:00.000 
Reading DITHER file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/History/DITHER.txt
Reading RADMON file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/History/RADMON.txt
Read 258 ACA bad pixels from /proj/sot/ska/jeanproj/git/starcheck/starcheck/data/ACABadPixels
Read 46 bad AGASC IDs from /proj/sot/ska/jeanproj/git/starcheck/starcheck/data/agasc.bad
#####################################################################
# calc_ccd_temps run at Mon Jan  9 12:47:10 2023 by jeanconn
# Continuity run_start_time = 2023:009:17:47:09.830
# calc_ccd_temps version = 14.0.1.dev1+gcc6be07
# chandra_models version = 3.45
# kadi version = 7.2.0
#####################################################################

Using backstop file /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/CR140_0101.backstop
Found 1277 backstop commands between 2019:140:00:57:00.000 and 2019:146:23:52:35.589
RLTT = 2019:140:00:57:00.000
sched_stop = 2019:146:23:52:35.589
Fetching telemetry between 2019:139:00:57:00.000 and 2019:140:00:57:00.000
Calculating ACA thermal model
Propagation initial time and ACA: 2019:140:00:45:58.816 -9.50
Making temperature check plots
Writing plot file sctest/ccd_temperature.png
Checking star catalog for obsid 48165
Checking star catalog for obsid 48164
Wrote HTML report to sctest.html
Wrote text report to sctest.txt
0
(ska3-flight-2022.13rc0) jeanconn-fido> ./sandbox_starcheck -dir NOT_DIRECTORY -out sctest -max_obsids 2; echo $?
ERROR: No backstop file matching NOT_DIRECTORY/*.backstop

 at ./starcheck/src/starcheck.pl line 39.
	main::__ANON__("\x{a}") called at ./starcheck/src/starcheck.pl line 1137
	main::get_file("NOT_DIRECTORY/*.backstop", "backstop", "required") called at ./starcheck/src/starcheck.pl line 144
2
(ska3-flight-2022.13rc0) jeanconn-fido> ./sandbox_starcheck -dir /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/ -out sctest -max_obsids 2; echo $?
ERROR: No backstop file matching /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019//*.backstop

 at ./starcheck/src/starcheck.pl line 39.
	main::__ANON__("\x{a}") called at ./starcheck/src/starcheck.pl line 1137
	main::get_file("/proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019//*.backstop", "backstop", "required") called at ./starcheck/src/starcheck.pl line 144
255
(ska3-flight-2022.13rc0) jeanconn-fido> 

@jeanconn jeanconn mentioned this pull request Jan 9, 2023
1 task
@javierggt
Copy link
Contributor

This works for me.

@javierggt
Copy link
Contributor

and while you are at it, can you fix the indentation in that block? 😄

@jeanconn
Copy link
Contributor Author

jeanconn commented Jan 9, 2023

What's our indentation standard for perl anyway? I thought this looked OK actually.

@javierggt
Copy link
Contributor

javierggt commented Jan 9, 2023

I don't know what are your coding standards for perl, but indentation is always a good idea. The main idea is that the indentation should tell you right away what is the nesting level. This is true even in languages that use brackets to denote scope.

In this case, I was stumped when reading the code and had to go line by line to match the brackets. This is a small block so it does not matter much, but still...

@jeanconn
Copy link
Contributor Author

jeanconn commented Jan 9, 2023

You've lost me. I thought END block code should be indented, so it is, and each block that is an if statement is also indented. But it looks like some if it is tabs instead of spaces?

@jeanconn
Copy link
Contributor Author

jeanconn commented Jan 9, 2023

I'll fix the tabs instead of spaces.

@javierggt
Copy link
Contributor

ah, I see, it's a mixture of tabs and spaces. That should be forbidden in any coding standard 😉

So, whatever...

@jeanconn
Copy link
Contributor Author

jeanconn commented Jan 9, 2023

For "indentation standard" I really meant "what should we have for vscode and for perltidy to get something that displays ok". For perl, I was still sometimes opening this up in emacs which I think is happily using a mix of tabs and spaces that did not work for you. Editing it with "default" vscode" seems to have also left a mix of tabs and spaces but is now displaying them differently? I have stopped caring.

@javierggt
Copy link
Contributor

I assume you are waiting for @taldcroft but it seems ok to me.

@jeanconn jeanconn requested a review from javierggt January 9, 2023 20:51
@jeanconn
Copy link
Contributor Author

jeanconn commented Jan 9, 2023

Yes, it would be good to have a review, but I just requested one from you which I think would be fine for this radical change.

@taldcroft taldcroft changed the title Save and regurgitate exit status at END Save and return exit status at END Jan 9, 2023
Copy link
Member

@taldcroft taldcroft 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 to me and the testing validates the approach.

I refuse to approve any PR with the word "regurgitate" in the title, but I fixed that. 😄

@jeanconn
Copy link
Contributor Author

jeanconn commented Jan 9, 2023

🤣

@jeanconn jeanconn merged commit 65668ec into master Jan 9, 2023
@jeanconn jeanconn deleted the exit-state branch January 9, 2023 21:20
@taldcroft
Copy link
Member

Agreed w/ @javierggt that we should apply some formatting standards to starcheck, and ... #405

@javierggt javierggt mentioned this pull request Jan 10, 2023
@javierggt javierggt mentioned this pull request May 17, 2023
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