def setUpClass(cls):
        # Test expects that MAIL_ACC_PASSWORD is set with env var
        if CdswEnvVar.MAIL_ACC_PASSWORD.value not in os.environ:
            raise ValueError(f"Please set '{CdswEnvVar.MAIL_ACC_PASSWORD.value}' env var and re-run the test!")
        cls._setup_logging()
        cls.repo_root_dir = FileUtils.find_repo_root_dir(__file__, REPO_ROOT_DIRNAME)
        found_cdsw_dirs = FileUtils.find_files(
            cls.repo_root_dir,
            find_type=FindResultType.DIRS,
            regex=CDSW_DIRNAME,
            parent_dir="yarndevtools",
            single_level=False,
            full_path_result=True,
        )
        if len(found_cdsw_dirs) != 1:
            raise ValueError(
                f"Expected to find 1 dir with name {CDSW_DIRNAME} "
                f"and parent dir 'yarndevtools'. "
                f"Actual results: {found_cdsw_dirs}"
            )
        cls.repo_cdsw_root_dir = found_cdsw_dirs[0]
        cls.yarn_dev_tools_results_dir = FileUtils.join_path(cls.repo_cdsw_root_dir, "yarndevtools-results")
        cls.branchdiff_cdsw_runner_script = YarnCdswBranchDiffTests.find_cdsw_runner_script(
            os.path.join(cls.repo_cdsw_root_dir, BRANCH_DIFF_REPORTER_DIR_NAME)
        )
        cls.docker_test_setup = DockerTestSetup(
            DOCKER_IMAGE, create_image=CREATE_IMAGE, dockerfile_location=cls.repo_cdsw_root_dir, logger=CMD_LOG
        )

        exec_mode_env: str = OsUtils.get_env_value(CdswEnvVar.TEST_EXECUTION_MODE.value, TestExecMode.CLOUDERA.value)
        cls.exec_mode: TestExecMode = TestExecMode[exec_mode_env.upper()]

        # !! WARNING: User-specific settings !!
        if cls.exec_mode == TestExecMode.CLOUDERA:
            # We need both upstream / downstream repos for Cloudera-mode
            os.environ[CdswEnvVar.CLOUDERA_HADOOP_ROOT.value] = "/Users/snemeth/development/cloudera/hadoop/"
            os.environ[CdswEnvVar.HADOOP_DEV_DIR.value] = "/Users/snemeth/development/apache/hadoop"
        elif cls.exec_mode == TestExecMode.UPSTREAM:
            os.environ[CdswEnvVar.HADOOP_DEV_DIR.value] = "/Users/snemeth/development/apache/hadoop"
            os.environ[BranchComparatorEnvVar.REPO_TYPE.value] = RepoType.UPSTREAM.value
            os.environ[BranchComparatorEnvVar.FEATURE_BRANCH.value] = "origin/branch-3.3"
            os.environ[BranchComparatorEnvVar.MASTER_BRANCH.value] = "origin/trunk"
 def setUpClass(cls):
     cls._ensure_env_var_is_present("test_env_var")
     cls._setup_logging()
     cls.repo_root_dir = FileUtils.find_repo_root_dir(__file__, REPO_ROOT_DIRNAME)
     cls._setup_dirs()
 def find_git_compare_script():
     repo_root_dir = FileUtils.find_repo_root_dir(__file__,
                                                  REPO_ROOT_DIRNAME)
     return FileUtils.join_path(repo_root_dir, "legacy-scripts",
                                "branch-comparator", "git_compare.sh")