def Go(self): # Get the environment set up. RetryCount = 0 failure_count = 0 logging.log(edk2_logging.SECTION, "Initial update of environment") (build_env_old, shell_env_old, _) = self.PerformUpdate() self_describing_environment.DestroyEnvironment() # Loop updating dependencies until there are 0 new dependencies or # we have exceeded retry count. This allows dependencies to carry # files that influence the SDE. logging.log(edk2_logging.SECTION, "Second pass update of environment") while RetryCount < Edk2Update.MAX_RETRY_COUNT: (build_env, shell_env, failure_count) = self.PerformUpdate() if not build_env_changed(build_env, build_env_old): # check if the environment changed on our last update break # if the environment has changed, increment the retry count and notify user RetryCount += 1 logging.log(edk2_logging.SECTION, f"Something in the environment changed. Updating environment again. Pass {RetryCount}") build_env_old = build_env self_describing_environment.DestroyEnvironment() if failure_count != 0: logging.error(f"We were unable to successfully update {failure_count} dependencies in environment") if RetryCount >= Edk2Update.MAX_RETRY_COUNT: logging.error(f"We did an update more than {Edk2Update.MAX_RETRY_COUNT} times.") logging.error("Please check your dependencies and make sure you don't have any circular ones.") return 1 return failure_count
def tearDown(self): shell_environment.GetEnvironment().restore_initial_checkpoint() TestEdk2CiSetup.restart_logging() buildFolder = os.path.join(self.minimalTree, "Build") shutil.rmtree(buildFolder, ignore_errors=True) self_describing_environment.DestroyEnvironment() version_aggregator.ResetVersionAggregator() pass
def tearDown(self): shell_environment.GetEnvironment().restore_initial_checkpoint() buildFolder = os.path.join(self.minimalTree, "Build") shutil.rmtree(buildFolder, ignore_errors=True) TestEdk2PlatBuild.restart_logging() # we need to make sure to tear down the version aggregator and the SDE self_describing_environment.DestroyEnvironment() version_aggregator.ResetVersionAggregator() pass
def tearDown(self): shell_environment.GetEnvironment().restore_initial_checkpoint() for temp_folder in TestEdk2Update.temp_folders: logging.info(f"Cleaning up {temp_folder}") # shutil.rmtree(os.path.abspath(temp_folder), ignore_errors=True) TestEdk2Update.restart_logging() # we need to make sure to tear down the version aggregator and the SDE self_describing_environment.DestroyEnvironment() version_aggregator.ResetVersionAggregator()
def Go(self): # Get the environment set up. RetryCount = 0 logging.log(edk2_logging.SECTION, "First Update") (build_env_old, shell_env_old) = self.PerformUpdate() self_describing_environment.DestroyEnvironment() while True: RetryCount += 1 logging.log(edk2_logging.SECTION, f"Retry Count: {RetryCount}") (build_env, shell_env) = self.PerformUpdate() if not build_env_changed(build_env, build_env_old): break build_env_old = build_env self_describing_environment.DestroyEnvironment() return 0
def setUp(self): self.workspace = os.path.abspath(tempfile.mkdtemp()) # we need to make sure to tear down the version aggregator and the SDE self_describing_environment.DestroyEnvironment() version_aggregator.ResetVersionAggregator()