From 719991b78af9ac6915179209771be4138065e182 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Wed, 21 Jun 2023 16:18:22 +0200 Subject: Use a cargo feature to allow disabling docker tests in CI Ideally these tests would run in CI, but that would require docker in docker, since CI runs its tests in docker. --- tests/server_shell.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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()?; -- cgit v1.2.3