Exemplo n.º 1
0
    def run_phase(self, success_change=False):  # pylint: disable=arguments-differ
        """
        Runs both phases of the two-phase test and compares their results
        If success_change is True, success requires some files to be different
        """
        first_phase = self._case1.get_value(
            "RESUBMIT") == 1  # Only relevant for multi-submit tests
        run_type = self._case1.get_value("RUN_TYPE")

        # First run
        if not self._multisubmit or first_phase:
            logger.info('Doing first run: ' + self._run_one_description)
            self._activate_case1()
            self._case_one_custom_prerun_action()
            self.run_indv(suffix=self._run_one_suffix)
            self._case_one_custom_postrun_action()

        # Second run
        if not self._multisubmit or not first_phase:
            # Subtle issue: case1 is already in a writeable state since it tends to be opened
            # with a with statement in all the API entrances in CIME. case2 was created via clone,
            # not a with statement, so it's not in a writeable state, so we need to use a with
            # statement here to put it in a writeable state.
            with self._case2:
                logger.info('Doing second run: ' + self._run_two_description)
                self._activate_case2()
                # we need to make sure run2 is properly staged.
                if run_type != "startup":
                    check_case(self._case2)

                self._case_two_custom_prerun_action()
                self.run_indv(suffix=self._run_two_suffix)
                self._case_two_custom_postrun_action()
            # Compare results
            # Case1 is the "main" case, and we need to do the comparisons from there
            self._activate_case1()
            self._link_to_case2_output()
            self._component_compare_test(self._run_one_suffix,
                                         self._run_two_suffix,
                                         success_change=success_change)
Exemplo n.º 2
0
    def run_phase(self, success_change=False):  # pylint: disable=arguments-differ
        """
        Runs both phases of the two-phase test and compares their results
        If success_change is True, success requires some files to be different
        """
        first_phase = self._case1.get_value("RESUBMIT") == 1 # Only relevant for multi-submit tests
        run_type = self._case1.get_value("RUN_TYPE")
        # First run
        if not self._multisubmit or first_phase:
            logger.info('Doing first run: ' + self._run_one_description)
            self._activate_case1()
            self._case_one_custom_prerun_action()
            self.run_indv(suffix = self._run_one_suffix)
            self._case_one_custom_postrun_action()

        # Second run
        if not self._multisubmit or not first_phase:
            # Subtle issue: case1 is already in a writeable state since it tends to be opened
            # with a with statement in all the API entrances in CIME. case2 was created via clone,
            # not a with statement, so it's not in a writeable state, so we need to use a with
            # statement here to put it in a writeable state.
            with self._case2:
                logger.info('Doing second run: ' + self._run_two_description)
                self._activate_case2()
                # we need to make sure run2 is properly staged.
                if run_type != "startup":
                    check_case(self._case2)
                self._force_case2_settings()

                self._case_two_custom_prerun_action()
                self.run_indv(suffix = self._run_two_suffix)
                self._case_two_custom_postrun_action()
            # Compare results
            # Case1 is the "main" case, and we need to do the comparisons from there
            self._activate_case1()
            self._link_to_case2_output()
            self._component_compare_test(self._run_one_suffix, self._run_two_suffix, success_change=success_change)