Skip to content

Commit

Permalink
Limit tests to ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejbrown committed Aug 22, 2024
1 parent 9ac4373 commit 59140ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/buildrunner-deploy-*
- name: Test with pytest
run: pytest -v --junitxml=test-reports/test-results.xml
# run: pytest -v --junitxml=test-reports/test-results.xml
run: pytest -v -k tests/test_buildrunner_files.py -k test_buildrunner_dir -s --junitxml=test-reports/test-results.xml
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
# exclude this step for 3.6, since it fails due to a breaking change to EnricoMi/publish-unit-test-result-action
Expand Down
2 changes: 2 additions & 0 deletions buildrunner/sshagent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def start(self, keys):
- keys a dict with the key being the file path and the value being a
password (or null if not required)
"""
self.log.write("!!! Starting ssh-agent container\n")
self.log.write(f"!!! {keys=}\n")
# load the keys
if not keys:
raise BuildRunnerConfigurationError("Invalid private keys")
Expand Down
2 changes: 1 addition & 1 deletion buildrunner/steprunner/tasks/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,13 +821,13 @@ def run(self, context: dict): # pylint: disable=too-many-statements,too-many-br

# see if we need to inject ssh keys
if self.step.ssh_keys:
# TODO Inject ssh_keys to mp_builder
self._sshagent = DockerSSHAgentProxy(
self._docker_client,
self.step_runner.log,
buildrunner_config.global_config.docker_registry,
self.step_runner.multi_platform,
)
self.step_runner.multi_platform
self._sshagent.start(
buildrunner_config.get_ssh_keys_from_aliases(
self.step.ssh_keys,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_buildrunner_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def _get_test_runs(test_dir: str) -> List[Tuple[str, str, Optional[List[str]], i
[
file_name
for file_name in os.listdir(test_dir)
if file_name.startswith("test-") and file_name.endswith(".yaml")
if file_name == "test-ssh.yaml"
# if file_name.startswith("test-ssh") and file_name.endswith(".yaml")
]
)
return [
Expand Down

0 comments on commit 59140ca

Please sign in to comment.