Merge pull request #1145 from firesim/ci-remove-python-filter

ci: don't filter out python tests
This commit is contained in:
Tim Snyder 2022-07-26 09:48:21 +00:00 committed by GitHub
commit 3a0ff08122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 26 deletions

View File

@ -37,7 +37,6 @@ jobs:
# Queried by downstream jobs to determine if they should run. # Queried by downstream jobs to determine if they should run.
outputs: outputs:
needs-manager: ${{ steps.filter.outputs.all_count != steps.filter.outputs.skip-manager_count }} needs-manager: ${{ steps.filter.outputs.all_count != steps.filter.outputs.skip-manager_count }}
needs-manager-python-only: ${{ steps.filter.outputs.python-manager }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -60,14 +59,6 @@ jobs:
- '**/.gitignore' - '**/.gitignore'
- '.github/ISSUE_TEMPLATE/**' - '.github/ISSUE_TEMPLATE/**'
# Python-specific manager filter
python-manager:
- 'deploy/firesim'
- 'deploy/awstools/**'
- 'deploy/buildtools/**'
- 'deploy/runtools/**'
- 'deploy/util/**'
setup-self-hosted-manager: setup-self-hosted-manager:
name: setup-self-hosted-manager name: setup-self-hosted-manager
needs: change-filters needs: change-filters
@ -123,8 +114,7 @@ jobs:
run-manager-pytests: run-manager-pytests:
name: run-manager-pytests name: run-manager-pytests
needs: [setup-manager, change-filters] needs: [setup-manager]
if: needs.change-filters.outputs.needs-manager-python-only == 'true'
runs-on: ${{ github.run_id }} runs-on: ${{ github.run_id }}
env: env:
TERM: xterm-256-color TERM: xterm-256-color
@ -135,8 +125,7 @@ jobs:
run-python-typecheck: run-python-typecheck:
name: run-python-typecheck name: run-python-typecheck
needs: [setup-manager, change-filters] needs: [setup-manager]
if: needs.change-filters.outputs.needs-manager-python-only == 'true'
runs-on: ${{ github.run_id }} runs-on: ${{ github.run_id }}
env: env:
TERM: xterm-256-color TERM: xterm-256-color

View File

@ -100,6 +100,7 @@ class BuildTmpYamlSet(TmpYamlSet):
build: TmpYaml build: TmpYaml
recipes: TmpYaml recipes: TmpYaml
hwdb: TmpYaml hwdb: TmpYaml
non_existent_file: Path
def write(self): def write(self):
self.build.write() self.build.write()
@ -108,9 +109,14 @@ class BuildTmpYamlSet(TmpYamlSet):
@property @property
def args(self): def args(self):
# set configs that should not be read explicitly
# to the non_existent_file to avoid influence of
# whether `firesim managerinit` has been run
# https://github.com/firesim/firesim/pull/1145#issuecomment-1194392085
return ['-b', fspath(self.build.path), return ['-b', fspath(self.build.path),
'-r', fspath(self.recipes.path), '-r', fspath(self.recipes.path),
'-a', fspath(self.hwdb.path), '-a', fspath(self.hwdb.path),
'-c', fspath(self.non_existent_file)
] ]
@property @property
@ -123,16 +129,25 @@ class RunTmpYamlSet(TmpYamlSet):
Attributes: Attributes:
""" """
recipes: TmpYaml
hwdb: TmpYaml hwdb: TmpYaml
run: TmpYaml run: TmpYaml
non_existent_file: Path
def write(self): def write(self):
self.recipes.write()
self.hwdb.write() self.hwdb.write()
self.run.write() self.run.write()
@property @property
def args(self): def args(self):
return ['-a', fspath(self.hwdb.path), # set configs that should not be read explicitly
# to the non_existent_file to avoid influence of
# whether `firesim managerinit` has been run
# https://github.com/firesim/firesim/pull/1145#issuecomment-1194392085
return ['-b', fspath(self.non_existent_file),
'-r', fspath(self.recipes.path),
'-a', fspath(self.hwdb.path),
'-c', fspath(self.run.path)] '-c', fspath(self.run.path)]
@property @property
@ -145,6 +160,14 @@ def sample_backup_configs() -> Path:
dir.is_dir().should.equal(True) dir.is_dir().should.equal(True)
return dir return dir
@pytest.fixture()
def non_existent_file(tmp_path: Path) -> Path:
# tmp_path is builtin pytest fixture to get a per-test temporary directory that should be clean
# but we still make sure that it doesn't exist before giving it
file = tmp_path / 'GHOST_FILE'
file.exists().should.equal(False)
return file
@pytest.fixture() @pytest.fixture()
def scy_build(tmp_path: Path, sample_backup_configs: Path) -> TmpYaml: def scy_build(tmp_path: Path, sample_backup_configs: Path) -> TmpYaml:
return TmpYaml(tmp_path, sample_backup_configs / 'sample_config_build.yaml') return TmpYaml(tmp_path, sample_backup_configs / 'sample_config_build.yaml')
@ -154,8 +177,8 @@ def scy_build_recipes(tmp_path: Path, sample_backup_configs: Path) -> TmpYaml:
return TmpYaml(tmp_path, sample_backup_configs / 'sample_config_build_recipes.yaml') return TmpYaml(tmp_path, sample_backup_configs / 'sample_config_build_recipes.yaml')
@pytest.fixture() @pytest.fixture()
def build_yamls(scy_build, scy_build_recipes, scy_hwdb) -> BuildTmpYamlSet: def build_yamls(scy_build: TmpYaml, scy_build_recipes: TmpYaml, scy_hwdb: TmpYaml, non_existent_file: Path) -> BuildTmpYamlSet:
return BuildTmpYamlSet(scy_build, scy_build_recipes, scy_hwdb) return BuildTmpYamlSet(scy_build, scy_build_recipes, scy_hwdb, non_existent_file)
@pytest.fixture() @pytest.fixture()
def scy_hwdb(tmp_path: Path, sample_backup_configs: Path) -> TmpYaml: def scy_hwdb(tmp_path: Path, sample_backup_configs: Path) -> TmpYaml:
@ -166,16 +189,8 @@ def scy_runtime(tmp_path: Path, sample_backup_configs: Path) -> TmpYaml:
return TmpYaml(tmp_path, sample_backup_configs / 'sample_config_runtime.yaml') return TmpYaml(tmp_path, sample_backup_configs / 'sample_config_runtime.yaml')
@pytest.fixture() @pytest.fixture()
def run_yamls(scy_hwdb: TmpYaml, scy_runtime: TmpYaml) -> RunTmpYamlSet: def run_yamls(scy_build_recipes: TmpYaml, scy_hwdb: TmpYaml, scy_runtime: TmpYaml, non_existent_file: Path) -> RunTmpYamlSet:
return RunTmpYamlSet(scy_hwdb, scy_runtime) return RunTmpYamlSet(scy_build_recipes, scy_hwdb, scy_runtime, non_existent_file)
@pytest.fixture()
def non_existent_file(tmp_path):
# tmp_path is builtin pytest fixture to get a per-test temporary directory that should be clean
# but we still make sure that it doesn't exist before giving it
file = tmp_path / 'GHOST_FILE'
file.exists().should.equal(False)
return file
@pytest.fixture() @pytest.fixture()
def firesim_parse_args(): def firesim_parse_args():