Exemplo n.º 1
0
def _make_cs_status_non_suite(testroot, testid_base):
    """Makes a cs.status file for a single run of create_test - not a whole test suite"""
    create_cs_status(test_root=testroot,
                     test_id=testid_base,
                     extra_args=(_CS_STATUS_FAILS_EXTRA_ARGS + ' ' +
                                 _cs_status_xfail_arg()),
                     filename='cs.status.fails')
Exemplo n.º 2
0
def _make_cs_status_for_suite(testroot, testid_base):
    """Makes a cs.status file that can be run for the entire test suite"""
    testid_pattern = testid_base + '_' + _NUM_COMPILER_CHARS * '?'
    # The basic cs.status just aggregates results from all of the individual create_tests
    create_cs_status(test_root=testroot,
                     test_id=testid_pattern,
                     filename='cs.status')
    # cs.status.fails additionally filters the results so that only failures are shown
    create_cs_status(test_root=testroot,
                     test_id=testid_pattern,
                     extra_args=_CS_STATUS_EXTRA_ARGS,
                     filename='cs.status.fails')
Exemplo n.º 3
0
    def _setup_cs_files(self):
    ###########################################################################
        try:
            python_libs_root = get_python_libs_root()

            create_cs_status(test_root=self._test_root,
                             test_id=self._test_id)

            template_file = os.path.join(python_libs_root, "cs.submit.template")
            template = open(template_file, "r").read()
            setup_cmd = "./case.setup" if self._no_setup else ":"
            build_cmd = "./case.build" if self._no_build else ":"
            test_cmd  = "./case.submit"
            template = template.replace("<SETUP_CMD>", setup_cmd).\
                       replace("<BUILD_CMD>", build_cmd).\
                       replace("<RUN_CMD>", test_cmd).\
                       replace("<TESTID>", self._test_id)

            if self._no_run:
                cs_submit_file = os.path.join(self._test_root, "cs.submit.{}".format(self._test_id))
                with open(cs_submit_file, "w") as fd:
                    fd.write(template)
                os.chmod(cs_submit_file,
                         os.stat(cs_submit_file).st_mode | stat.S_IXUSR | stat.S_IXGRP)

            if self._cime_model == "cesm":
                template_file = os.path.join(python_libs_root, "testreporter.template")
                template = open(template_file, "r").read()
                template = template.replace("<PATH>",
                                            os.path.join(self._cime_root, "scripts", "Tools"))
                testreporter_file = os.path.join(self._test_root, "testreporter")
                with open(testreporter_file, "w") as fd:
                    fd.write(template)
                os.chmod(testreporter_file, os.stat(testreporter_file).st_mode
                         | stat.S_IXUSR | stat.S_IXGRP)

        except Exception as e:
            logger.warning("FAILED to set up cs files: {}".format(str(e)))