Commit graph

7 commits

Author SHA1 Message Date
Kumi 930dd014fe
feat: add delay for SSH server readiness in CI
Some checks failed
Test! / test (push) Failing after 1m38s
Introduced a step in the CI test workflow to wait for the SSH server to start before proceeding with subsequent actions. This ensures that the server is fully operational and can accept connections before any attempts are made to copy the public key into the Docker container, avoiding potential race conditions where the server might not be ready in time, leading to failed CI runs. The addition of a simple loop with a timeout mechanism improves the reliability of the CI pipeline by making sure tests only run when all services are up and running.
2024-04-22 18:05:50 +02:00
Kumi 78fcec897e
fix(ci): ensure fresh SSH server container setup
Some checks failed
Test! / test (push) Failing after 1m45s
Ensured the SSH server Docker container is always rebuilt from a clean state by forcefully removing any pre-existing container before creation. Additionally, updated the SSH connection user to 'replication' to align with new security protocols.

- The force removal of the existing 'ssh-server' container avoids potential conflicts or inconsistencies due to leftover state from previous test runs, ensuring a more reliable integration testing environment.
- Switching the SSH connection to use the 'replication' user account instead of 'root' enhances security and adheres to best practices by minimizing the use of elevated privileges.

These changes contribute to a more stable and secure CI pipeline by reducing flakiness in tests and aligning with security best practices.
2024-04-22 17:58:32 +02:00
Kumi c72c45f47b
feat(workflows): ensure SSH dir exists before scanning host
Some checks failed
Test! / test (push) Failing after 1m17s
Preemptively creating the `~/.ssh` directory before attempting to add the SSH server's host key to `known_hosts`. This change prevents potential failures in CI workflows where the `.ssh` directory might not exist on a fresh runner environment, ensuring a smoother and more reliable setup for SSH connections.

This adjustment enhances the resilience of the testing workflow by avoiding errors related to missing directories, thereby improving automated testing reliability and efficiency.
2024-04-22 17:06:21 +02:00
Kumi efe8c1a37f
fix: correct Docker build context for SSH server
Some checks failed
Test! / test (push) Failing after 2m30s
The Docker build command for the SSH server container was incorrectly pointing to the Dockerfile instead of the directory containing it. This change corrects the build context to the correct directory, ensuring that all necessary files in `./ci-tests/` are included during the build process. This fix addresses issues with missing dependencies during the container build phase.
2024-04-22 17:01:42 +02:00
Kumi c5ae1eef67
refactor(test.yml): use apt-get without sudo in CI
Some checks failed
Test! / test (push) Failing after 1m18s
Optimized the Docker installation commands in the CI workflow by removing `sudo` when calling `apt-get`. This adjustment caters to environments where the CI runner executes as root or has adequate permissions, streamlining command execution and avoiding potential issues related to `sudo` availability or configuration. This change harmonizes with CI practices that favor minimalist, permission-aware setups.
2024-04-22 16:59:14 +02:00
Kumi d4afc756c4
feat(workflows): Add Docker installation step
Some checks failed
Test! / test (push) Failing after 8s
To facilitate the execution of tests within a controlled environment, Docker is now installed as part of the CI testing workflow. This addition ensures that any Docker-dependent steps, specifically the building and running of an SSH Server Docker container, execute seamlessly. Previously, the assumption was that Docker would be pre-installed on the runner, which could lead to inconsistencies or failures in environments where this was not the case. By explicitly including the Docker installation step, the workflow becomes more portable and resilient across different CI execution environments.
2024-04-22 16:58:23 +02:00
Kumi d1bf34ab1f
feat: Introduce automated SSH testing flow
Implemented a new CI pipeline configured to automatically test SSH connectivity as part of the project's testing phase. This involves creating and configuring a Docker container to serve as an SSH server, generating an SSH key pair for secure connection, and ensuring the build environment can establish an SSH connection to the container without manual intervention. The setup aims to automate and streamline testing of SSH-related functionalities, enhancing the reliability of code changes affecting remote server interactions.

- A Dockerfile was added to set up an SSH server in a container.
- The CI pipeline (`test.yml`) was configured to build this container, generate SSH keys, copy the public key to the container, and attempt an SSH connection.

This enhancement supports more robust testing processes, particularly for features that interact with remote servers via SSH.
2024-04-22 16:47:20 +02:00