summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.woodpecker.yml2
-rw-r--r--CHANGELOG.md6
-rw-r--r--Cargo.toml4
-rw-r--r--tests/server_shell.rs7
4 files changed, 18 insertions, 1 deletions
diff --git a/.woodpecker.yml b/.woodpecker.yml
index f3b0e5c..cee339a 100644
--- a/.woodpecker.yml
+++ b/.woodpecker.yml
@@ -4,4 +4,4 @@ pipeline:
environment: [CARGO_TERM_COLOR=always]
commands:
- rustup default stable
- - cargo test
+ - cargo test --no-default-features
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cd6ea83..598ff2b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Added
+
+- Added feature flag "docker_tests". This only affects which tests are run by
+ default, so that the CI environment can skip tests that require running
+ docker.
+
## [0.1.1] - 2023-05-10
### Changed
diff --git a/Cargo.toml b/Cargo.toml
index 02113e2..8bcad68 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,6 +31,10 @@ once_cell = "1.17.1"
tempfile = "3.4.0"
rexpect = "0.5.0"
+[features]
+docker_tests = []
+default = ["docker_tests"]
+
[profile.dev.package."*"]
opt-level = 3
# incremental compile is rarely useful for dependencies since they change
diff --git a/tests/server_shell.rs b/tests/server_shell.rs
index 22f3d3b..806f901 100644
--- a/tests/server_shell.rs
+++ b/tests/server_shell.rs
@@ -164,6 +164,7 @@ fn make_new_shared_repo(c: &TestContext, group: &str, repo_name: &str) -> Result
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn shows_a_prompt() -> Result<()> {
let c = spawn_ssh_server()?;
connect_to_ssh_server_interactively(&c)?;
@@ -237,6 +238,7 @@ fn commit_dummy_content(c: &TestContext, repo_name: &str) -> Result<()> {
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn git_clone_works_with_an_empty_repo() -> Result<()> {
let c = spawn_ssh_server()?;
let repo_name = "my-new-clonable-repo";
@@ -247,6 +249,7 @@ fn git_clone_works_with_an_empty_repo() -> Result<()> {
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn git_push_works() -> Result<()> {
let c = spawn_ssh_server()?;
let repo_name = "my-new-pushable-repo";
@@ -259,6 +262,7 @@ fn git_push_works() -> Result<()> {
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn git_clone_works_with_an_empty_shared_repo() -> Result<()> {
let c = spawn_ssh_server()?;
let repo_name = "my-new-clonable-repo";
@@ -270,6 +274,7 @@ fn git_clone_works_with_an_empty_shared_repo() -> Result<()> {
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn git_push_works_with_shared_repo() -> Result<()> {
let c = spawn_ssh_server()?;
let repo_name = "my-new-pushable-repo";
@@ -283,6 +288,7 @@ fn git_push_works_with_shared_repo() -> Result<()> {
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn git_clone_can_not_target_repo_outside_allowed_paths() -> Result<()> {
fn test_git_clone_unallowed_path(repo_name: &str) -> Result<()> {
let c = spawn_ssh_server()?;
@@ -319,6 +325,7 @@ fn init_local_git_dir(c: &TestContext, repo_name: &str) {
}
#[test]
+#[cfg_attr(not(feature = "docker_tests"), ignore)]
fn git_push_can_not_target_repo_outside_allowed_paths() -> Result<()> {
fn test_push_to_unallowed_path(repo_name: &str) -> Result<()> {
let c = spawn_ssh_server()?;