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 error messaging logging for ams jobs SO107 SCMSUITE-8725 #182

Merged
merged 12 commits into from
Dec 9, 2024

Conversation

dormrod
Copy link
Contributor

@dormrod dormrod commented Dec 5, 2024

Description

Log any results of AMSJob.get_errormsg to the default logger at the end of the job.
This makes it clear in the std output what may have gone wrong e.g.

[05.12|13:56:39] Error message for job water_optimization was:
	 LICENSE INVALID
	 ---------------
	
	 Your license does not include module AMS version 2024.206 on this machine.
	
	 Module AMS
	 Version 2024.206
	 Machine: XXXXX
	
	 License file: ./license.txt

Add a small tweak to get_errormsg to handle license issues, and small unit test.

Note that this limits any error logs to 20 lines (arbitrary choice).

Also make the message

WARNING: Trying to obtain results of crashed or failed job crashing_job

slightly less spammy by ignoring it when called from ok, check or get_errormsg

@dormrod dormrod force-pushed the DavidOrmrodMorley/immediate-err-logging branch 3 times, most recently from fb00d3b to 4cb7e51 Compare December 5, 2024 13:56
@dormrod dormrod force-pushed the DavidOrmrodMorley/immediate-err-logging branch from 4cb7e51 to f559af6 Compare December 5, 2024 14:08
@dormrod dormrod marked this pull request as draft December 5, 2024 14:37
@dormrod dormrod marked this pull request as ready for review December 6, 2024 08:33
@dormrod dormrod force-pushed the DavidOrmrodMorley/immediate-err-logging branch from f205bde to 6473fab Compare December 6, 2024 09:45
@dormrod dormrod requested a review from mhellstr December 6, 2024 10:02
3,
)

assert mock_stdout.getvalue() == (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-12-06 at 12 54 23

@dormrod dormrod merged commit dcc9d11 into trunk Dec 9, 2024
17 checks passed
@dormrod dormrod deleted the DavidOrmrodMorley/immediate-err-logging branch December 9, 2024 09:45
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.

2 participants