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

Replace create_test's Perl-based implementation with Python #350

Merged
merged 6 commits into from
Oct 14, 2015

Conversation

jgfouca
Copy link
Member

@jgfouca jgfouca commented Oct 9, 2015

Details:

  • Encapsulate test_name parsing/handling
  • New create_test_impl.py that basically does what the Perl create_test did
    • Exceptions to this
      • Better tracking of what phase a test is in
      • Better error handling
      • Does NOT rely on cs.submit to submit tests, just does this itself
      • More output is shepharded into the TestStatus.log file (less output escape)
  • Refactor to how TestStatus file is handling
    • Proper management of this file is crucial for wait_for_tests which is crucial to our dashboard
    • NEVER leave TestStatus in a RUN/PEND state when things have actually FAILed
    • Enumerate all phases in TestStatus file
    • Try to encapsulate responsibility for TestStatus file management into create_test
    • Change format to 'STATE TESTNAME PHASE' (whitespace separated)
    • Remove clutter being dumped to TestStatus, that stuff belongs in logs
    • Add regresion test for create_test
    • Add support for COMMENT state if random stuff really needs to be dumped into TestStatus
    • These changes had broad impacts across CIME
  • Add xml_brige tool: Allows python programs to talk to CIME ConfigCase perl module

Unrelated:

  • Add parallelism to gptl and mct builds
  • Change melvin to have 32 pes
  • Use python 'with' statement when opening files for writing

SEG-184

[BFB]

Details:
* Encapsulate test_name parsing/handling
* New create_test_impl.py that basically does what the Perl create_test did
  * Exceptions to this
    * Better tracking of what phase a test is in
    * Better error handling
    * Does NOT rely on cs.submit to submit tests, just does this itself
    * More output is shepharded into the TestStatus.log file (less output escape)
* Refactor to how TestStatus file is handling
  * Proper management of this file is crucial for wait_for_tests which is crucial to our dashboard
  * NEVER leave TestStatus in a RUN/PEND state when things have actually FAILed
  * Enumerate all phases in TestStatus file
  * Try to encapsulate responsibility for TestStatus file management into create_test
  * Change format to 'STATE TESTNAME PHASE' (whitespace separated)
  * Remove clutter being dumped to TestStatus, that stuff belongs in logs
  * Add regresion test for create_test
  * Add support for COMMENT state if random stuff really needs to be dumped into TestStatus
  * These changes had broad impacts across CIME
* Add xml_brige tool: Allows python programs to talk to CIME ConfigCase perl module

Unrelated:
* Add parallelism to gptl and mct builds
* Change melvin to have 32 pes
* Use python 'with' statement when opening files for writing

SEG-184

[BFB]
@jgfouca jgfouca force-pushed the jgfouca/scripts-acme/create_test_impl branch from 2afd408 to 8b8964e Compare October 9, 2015 17:54
@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

This has been thoroughly tested on skybridge and melvin.

@rljacob
Copy link
Member

rljacob commented Oct 9, 2015

Why were the echo's to TESTSTATUS_OUT removed from all the test scripts?

@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

Because the TestStatus file is for communicating the state of the test and what phase it's in. Lots of stuff was being dumped there that should have been in a log file instead. Also, part of the effort here was to encapsulate TestStatus management inside of create_test as much as possible.

@jeff-cohere
Copy link
Contributor

Shall we send this through a testing cycle on next, @jgfouca?

@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

Yep! :)

@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

Unless there are implementation details that you'd like me to change. I know it's a lot to take in; the main work is in create_test_impl.py.

@jeff-cohere
Copy link
Contributor

It's not particularly invasive, and I didn't see anything that raised my eyebrows much higher than they usually sit. Let's see how it goes.

@jeff-cohere
Copy link
Contributor

Although...

Would it be difficult for you to break out the unrelated work you cite in the bottom of your PR description? These things:

  • Add parallelism to gptl and mct builds
  • Change melvin to have 32 pes
  • Use python 'with' statement when opening files for writing

@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

It wouldn't be too difficult, but I don't know that it would add much value. As the kids would say, I already "epic-failed" to break this change down into small independent commits. I was making commits as I went, but often with things in a non-working, arbitrary state so I just squashed it all for the pull request.

@jeff-cohere
Copy link
Contributor

Ok, not a huge deal. The parallelism stuff was a separate but related discussion, so I thought separating that out might make sense.

@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

Yeah, the resulting change was so small as to hardly be worth a separate commit; it also had minimal impact on the core problem. I'll be taking a hard at what kind of parallelism we can get in create_test. The fact that individual case builds are really slow can be addressed by doing lots of case builds simultaneously. This should work well for larger test suites but not so well for my beloved "acme_tiny" suite that I rely on heavily for testing.

@jeff-cohere
Copy link
Contributor

[BFB]?

@jgfouca
Copy link
Member Author

jgfouca commented Oct 9, 2015

Yes, I amended the original commit to add BFB and a Jira task.

jeff-cohere pushed a commit that referenced this pull request Oct 9, 2015
Replace create_test's Perl-based implementation with Python

Details:

* Encapsulate test_name parsing/handling
* New create_test_impl.py that basically does what the Perl create_test did
  * Exceptions to this:
    * Better tracking of what phase a test is in
    * Better error handling
    * Does NOT rely on cs.submit to submit tests, just does this itself
    * More output is shepharded into the TestStatus.log file (less output escape)
* Refactor to how TestStatus file is handling
  * Proper management of this file is crucial for wait_for_tests which is crucial to our dashboard
  * NEVER leave TestStatus in a RUN/PEND state when things have actually FAILed
  * Enumerate all phases in TestStatus file
  * Try to encapsulate responsibility for TestStatus file management into create_test
  * Change format to 'STATE TESTNAME PHASE' (whitespace separated)
  * Remove clutter being dumped to TestStatus, that stuff belongs in logs
  * Add regresion test for create_test
  * Add support for COMMENT state if random stuff really needs to be dumped into TestStatus
  * These changes had broad impacts across CIME
* Add xml_brige tool: Allows python programs to talk to CIME ConfigCase perl module

Unrelated:

* Add parallelism to gptl and mct builds
* Change melvin to have 32 pes
* Use python 'with' statement when opening files for writing

SEG-184

[BFB]
jgfouca added a commit that referenced this pull request Oct 10, 2015
Fix bug in handling of case options

SEG-184

[BFB]

* jgfouca/scripts-acme/create_test_impl:
  Fix bug in handling of case options
jgfouca added a commit that referenced this pull request Oct 10, 2015
Fix for this branch

Fixed the removal of bld/run dirs, not cases. Now cases
fixed too.

[BFB]

* jgfouca/scripts/adjust_jenkins_testid:
  Fix for this branch
jgfouca added a commit that referenced this pull request Oct 10, 2015
…350)

Fix for this branch

Fixed the removal of bld/run dirs, not cases. Now cases
fixed too.

[BFB]

* jgfouca/scripts/adjust_jenkins_testid:
  Fix for this branch
Yeah... turns out the builds don't always work when you provide
a -j N to these builds. Sigh.

PEA_P1_M.f45_g37_rx1.A is the case that exposed this.

[BFB]
@jgfouca jgfouca force-pushed the jgfouca/scripts-acme/create_test_impl branch from d7e8d42 to 2aac7b2 Compare October 11, 2015 19:48
@jgfouca jgfouca force-pushed the jgfouca/scripts-acme/create_test_impl branch from 35bf6f7 to 4b4b912 Compare October 13, 2015 17:43
@jeff-cohere
Copy link
Contributor

@jgfouca, what's the status of this? I see that you've merged some stuff into master. Should this be closed?

@jgfouca
Copy link
Member Author

jgfouca commented Oct 14, 2015

Hi Jeff, it looks like these changes are working in the nightlies, but I haven't merged anything to master.

@jeff-cohere
Copy link
Contributor

So commit 9ce9d1c wasn't merged to master? I guess I'm confused.

@jgfouca
Copy link
Member Author

jgfouca commented Oct 14, 2015

That was a different pull request. It was the one dealing with not removing nightly results from other branches.

@jeff-cohere
Copy link
Contributor

Ah, ok. If this is working in the nightlies, I'll merge.

@jgfouca jgfouca force-pushed the jgfouca/scripts-acme/create_test_impl branch from 4b4b912 to 2810f78 Compare October 14, 2015 20:17
@jeff-cohere jeff-cohere merged commit 2810f78 into master Oct 14, 2015
jeff-cohere pushed a commit that referenced this pull request Oct 14, 2015
Replace create_test's Perl-based implementation with Python

Details:

* Encapsulate test_name parsing/handling
* New create_test_impl.py that basically does what the Perl create_test did
  * Exceptions to this
      * Better tracking of what phase a test is in
      * Better error handling
      * Does NOT rely on cs.submit to submit tests, just does this itself
      * More output is shepharded into the TestStatus.log file (less output escape)
  * Refactor to how TestStatus file is handling
    * Proper management of this file is crucial for wait_for_tests which is crucial to our dashboard
    * NEVER leave TestStatus in a RUN/PEND state when things have actually FAILed
    * Enumerate all phases in TestStatus file
    * Try to encapsulate responsibility for TestStatus file management into create_test
    * Change format to 'STATE TESTNAME PHASE' (whitespace separated)
    * Remove clutter being dumped to TestStatus, that stuff belongs in logs
    * Add regresion test for create_test
    * Add support for COMMENT state if random stuff really needs to be dumped into TestStatus
    * These changes had broad impacts across CIME
  * Add xml_brige tool: Allows python programs to talk to CIME ConfigCase perl module

Unrelated:

  * Add parallelism to gptl and mct builds
  * Change melvin to have 32 pes
  * Use python 'with' statement when opening files for writing

SEG-184

[BFB]
@jeff-cohere jeff-cohere deleted the jgfouca/scripts-acme/create_test_impl branch October 14, 2015 23:41
rljacob added a commit that referenced this pull request Aug 11, 2016
12d2135 Merge pull request #388 from ESMCI/jgfouca/need_to_report_build_exceptions
8f677cd Add test to ensure build fails report info to teststatus.log
7095ef0 Need to report build exception contents
7c9cc94 Merge pull request #387 from ESMCI/jgfouca/fix_case_build_return_code
bf941ed case.build needs to check success in order to return a sane error code
df432e8 update ChangeLog
154d5f8 Merge pull request #378 from ESMCI/rljacob/update-config-files
6b8fc76 Merge pull request #382 from ESMCI/sarich/fix-taskmaker-counter
5df46a2 Merge pull request #381 from jedwards4b/test_fixes
e58d624 component_compare_test was not properly reporting failures
0e0e577 Update acme config_files for mpas
84122dd Merge pull request #376 from ESMCI/jgfouca/changes_from_acme
38e2f8a More stuff from ACME
c86398e Merge pull request #375 from ESMCI/jgfouca/portable_run_cmd_utest
daaf621 Merge pull request #373 from ESMCI/jgfouca/enhance_bisect
e61ba96 Change MPAS compset for test
c77a64e Add homme python test
3031f00 Better support for 'none' module system
3ceef7b Make run_cmd_no_fail unit test more portable
bbd20fb Merge branch 'jgfouca/fix_module_list' (PR #374)
6eb8143 Reactivate creation of software_environment.txt
4dd30c6 Ensure module setup is sourced before list
c8bd20e fix bug in translation from perl
20a3412 cime_bisect: Add better support for modifying create_test run
77871de update changelog
e74906b comment out code until it works for tcsh users
4a13413 fix issue with module list
6ad4b2d update changelog
cef688d update changelog
835b511 Merge pull request #367 from jedwards4b/user_mod_0len_fix
b280b55 Merge pull request #362 from ESMCI/jgfouca/remove_perl_taskmaker
12a30ee Merge pull request #356 from ESMCI/jgfouca/minor_timing_chg
3fb0b80 Merge pull request #355 from ESMCI/jgfouca/wait_for_test_refactor
d083933 user_nl_ file was being removed if a user_nl file in any mods directory was missing
39de940 Fix comment
5d38420 Revert "Merge pull request #343 from ESMCI/wilke/scripts/xmlchange"
8dc2354 Merge pull request #363 from ESMCI/rljacob/machines/fix-acme
0773aac Increase default walltime for blues
c4dce0f Remove last uses of taskmaker.pl
76eb1bc Remove -A directive from edison
d67b267 Merge pull request #361 from billsacks/cism_nag
bf02e3e Merge pull request #357 from ekluzek/fixpionml
c9b8910 Seperate out modelio namelist definition since it uses the same names, but defines them differently
805ad7f Add -mismatch_all when compiling cism with nag
fff9a9b Set CHECK_TIMING to true in addition to SAVE_TIMING if --save-timing given to create_test
f25a518 wait_for_tests will now always specifically wait for the RUN phase
e19e72c Update drv buildnamelist test to work with cime5
db1538e Merge branch 'douglasjacobsen/add_lanl_machines' (PR #353)
893c6c6 Add support for LANL's mustang and wolf to cime
dea8a3a Merge pull request #350 from ESMCI/rerun_test_functionality
9b4488b Changes based on github feedback
c103e08 Add SAVE_TIMING_DIR for edison
98f95bb Merge pull request #341 from ESMCI/santos/fix-env-leakage
1b775e4 Fixes post-upstream-merge
ea97b56 Merge branch 'master' into rerun_test_functionality
1ca1b83 Merge pull request #348 from ESMCI/jayeshkrishna/machinefiles/get_acme_cime_dev_working_on_mira
252aea7 Merge pull request #343 from ESMCI/wilke/scripts/xmlchange
2db894f Add missing files
622b7d0 Complete
ba69385 progress
84000ee Fixing the runjob command for ACME on Mira
1a55232 Adding config for ERS_Ld3.ne30_g16_rx1.A test
d1df346 Error handling; check for correct length of key-value pair array after split
fa1cb49 listofsettings allways an array, test for length of array
a6a3d33 Changed number of expected positional arguments to 0 or 1 , warnings and debug statements
74d2100 checking for missing values in settings string from command line
cd350da Remove `GenericXML` check for env variables.
6ca6b59 progress
e7b334e Merge pull request #340 from ESMCI/douglasjacobsen/fix_test_template
43807a5 Add white space after batch directives in script templates
e061505 Merge pull request #337 from ESMCI/jgfouca/autosave_env_info
edc1671 Autosave environment information in case_setup.
33ce89b Merge pull request #336 from ESMCI/jgfouca/fix_create_test_not_catching_missing_project
c3f8f84 create_test was not failing the create_newcase phase when project info was missing
fef81df Merge pull request #335 from ESMCI/jgfouca/add_queue_option_to_create_test
731f8a0 Add ability to select queue to create_test and create_newcase
6f9613f Merge pull request #333 from ESMCI/jgfouca/even_more_sky_env_fixes
11877a2 Fix mismatch between MPI_PATH and the mpi module being loaded
d37e177 Merge pull request #322 from ESMCI/jgfouca/restore_good_python_version_error
ad18c34 Merge pull request #331 from ESMCI/jgfouca/reduce_output_from_check_input_data
0268cb7 Only report present files in debug mode
47b4216 Fix spelling mistake
dddd7f0 Merge pull request #327 from ESMCI/jgfouca/fix_more_sky_env_issues
07aeb52 Get cime_developer building again on skybridge.
0aceb94 Merge branch 'wilke/template/directives' (PR #324)
d8f331c moved batchdirectives to top of the template
dbbd3a1 Users should get a nice error when their python is too old
5eea798 Merge pull request #320 from ESMCI/jgfouca/fix_skybridge_env_issues
ca3e004 Fix skybridge environment problems, port to new SEMS modules
1a82a57 Merge pull request #318 from ESMCI/jgfouca/remove_sentinel_concept
e266dd9 Remove sentinel concept from jenkins_generic_job
aae8e30 comments for cime5.0.5
e20f807 Merge pull request #317 from billsacks/restore_lii
1967bb3 Restore LII test
c404dfa Merge remote-tracking branch 'origin/master'
0406b7d updates for cime5.0.4
7930cd7 Merge pull request #316 from ESMCI/jgfouca/update_code_checker
009f7a1 code_checker: Leverage .gitignore by using git ls-files instead of find to get list of ifles to check
c5555c7 Merge pull request #315 from Katetc/master
c4817d7 fix issue 314
7a493a0 remove multiple run lines from test file
c269ab9 Merge pull request #313 from ESMCI/jgfouca/correctly_report_problem_in_test
734e4b4 Rolling the Intel compiler back to v15.0.2
9a46a99 On batch systems, be sure to report that the problem is with wait_for_tests, not create_test
0e95d19 add some more info to README file
e9586c1 Changes required to support the new Hobart cluster configuration
cdb7805 update documentation for --xml options
98a0380 Merge pull request #307 from ESMCI/rljacob/tests/add-readme
46ff3c6 work on test rerunability
c5f2ae9 Merge pull request #308 from ESMCI/jgfouca/fix_check_input_bug
bddea72 document ERR test
8639ba1 create ability to run tests in same case more than once
b18580b Fix minor erroneous output bug in check_input_data
6f3e448 Add README back to Testcases
fd001a7 Add README back to SystemTests
929f05a Merge pull request #305 from ESMCI/jgfouca/advanced_profiling_tool
20c2e22 Make prof tools a bit more user friendly
1f9b49b Merge pull request #304 from jedwards4b/dynamic_system_test_dirs
0ba7f50 handle so that we dont have a list of test names to maintain
92a266e handle so that we dont have a list of test names to maintain
99f3d35 New tool 'advanced-py-prof'
4e6f7f5 initialize contents
3703d94 machine specific fixes for edison/cori/slurm systems
f6dc40a fixes git issue 303
7bacf48 repeat change for acme
503d5ad load system test directories dynamically based on paths in config_files.xml
b28ddff Merge pull request #302 from ESMCI/jgfouca/profiling_tool_etc
0e1553f Add a new tool for very simple python profiling
1eb2a56 Merge pull request #301 from jedwards4b/shell_commands_delete
2f78ec7 remove any existing shell_commands files from case before writing new ones
5f85c05 update changelog for tag
4ef656d pylint fixes
8624ece fix needed for scripts_regression_tests following PR298
6cc9110 These were supposed to be in PR296
d19afa9 Merge remote-tracking branch 'jedwards/testing_fixes' (PR #296)
b302243 Merge pull request #298 from ESMCI/jgfouca/restore_verbose
0a95b04 component_compare_test should fail if one of the components to be compared is not found"
9aa8683 Reintroduce verbose option into the refactored logging system
a796384 fix for lii test and response to review
d8c9b2e Merge pull request #286 from jedwards4b/buildnml_output_fix
1894e28 improve documetation of debug option, remove incorrect documentation of verbose option
21ef9ae remove whitespace surrounding test names
f6fdbb7 fix erp test update ChangeLog
b8b4723 Fix LII test
daa0c63 rename bisect unit test from acme to cime
4f1a079 move pecount code from create_test to create_newcase
24eb48f move clm include directory to prevent build confusion
1ee4449 add support for ascii testfile, allow multiple compilers in tests
d6c28b4 fix memleak test giving error if baseline not found
8ff5f19 Merge pull request #287 from ESMCI/nag_mismatch
a57e410 Remove `-mismatch_all` from NAG options in CESM.
5040500 output from buildnml scripts now prints

git-subtree-dir: cime
git-subtree-split: 12d2135
jgfouca pushed a commit that referenced this pull request Feb 27, 2018
Replace create_test's Perl-based implementation with Python

Details:

* Encapsulate test_name parsing/handling
* New create_test_impl.py that basically does what the Perl create_test did
  * Exceptions to this
      * Better tracking of what phase a test is in
      * Better error handling
      * Does NOT rely on cs.submit to submit tests, just does this itself
      * More output is shepharded into the TestStatus.log file (less output escape)
  * Refactor to how TestStatus file is handling
    * Proper management of this file is crucial for wait_for_tests which is crucial to our dashboard
    * NEVER leave TestStatus in a RUN/PEND state when things have actually FAILed
    * Enumerate all phases in TestStatus file
    * Try to encapsulate responsibility for TestStatus file management into create_test
    * Change format to 'STATE TESTNAME PHASE' (whitespace separated)
    * Remove clutter being dumped to TestStatus, that stuff belongs in logs
    * Add regresion test for create_test
    * Add support for COMMENT state if random stuff really needs to be dumped into TestStatus
    * These changes had broad impacts across CIME
  * Add xml_brige tool: Allows python programs to talk to CIME ConfigCase perl module

Unrelated:

  * Add parallelism to gptl and mct builds
  * Change melvin to have 32 pes
  * Use python 'with' statement when opening files for writing

SEG-184

[BFB]
yunpengshan2014 pushed a commit that referenced this pull request Apr 2, 2024
* work for all regions except for W pacific

* add new files

* add one more new files

* fix projection problems

* refine axis setting

* refine figure quality

* add TRMM data processing scripts

* fix units

* force test data on the same scale as ref

* modify figs

* add new parameter to scale DC amplitude

* address review
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