Skip to content

feat: Add RSpec test adapter and perform project cleanup (Jules test) #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 58 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions crates/adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ serde_json = { workspace = true }
serde = { workspace = true }
regex = { workspace = true }
clap = { workspace = true }
tree-sitter = "0.22.5"
tree-sitter-rust = "0.21.2"
tree-sitter = "0.20.10" # Downgraded
tree-sitter-rust = "0.20.0" # Downgraded
anyhow = { workspace = true }
tempfile = "3.10.1"
tree-sitter-javascript = "0.21.0"
tree-sitter-go = "0.21.0"
tree-sitter-php = "0.22.5"
tree-sitter-javascript = "0.20.1" # Downgraded
tree-sitter-go = "0.20.0" # Downgraded
tree-sitter-php = "0.20.0" # Downgraded
tree-sitter-ruby = "0.20.0" # Stays, compatible with tree-sitter 0.20.x
async-trait = "0.1.77"
once_cell = "1.19.0"
tracing-appender = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, default-features = false }
Expand Down
5 changes: 5 additions & 0 deletions crates/adapter/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This file makes the crate a library, allowing integration tests to link against it.

pub mod log;
pub mod model;
pub mod runner;
8 changes: 7 additions & 1 deletion crates/adapter/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::runner::deno::DenoRunner;
use crate::runner::go::GoTestRunner;
use crate::runner::node_test::NodeTestRunner;
use crate::runner::phpunit::PhpunitRunner;
use crate::runner::rspec::RspecRunner;
use crate::runner::vitest::VitestRunner;
use std::str::FromStr;
use testing_language_server::error::LSError;
Expand All @@ -21,8 +22,9 @@ pub enum AvailableTestKind {
Vitest(VitestRunner),
Deno(DenoRunner),
GoTest(GoTestRunner),
Phpunit(PhpunitRunner),
NodeTest(NodeTestRunner),
Phpunit(PhpunitRunner),
Rspec(RspecRunner),
}
impl Runner for AvailableTestKind {
fn discover(&self, args: DiscoverArgs) -> Result<(), LSError> {
Expand All @@ -35,6 +37,7 @@ impl Runner for AvailableTestKind {
AvailableTestKind::Vitest(runner) => runner.discover(args),
AvailableTestKind::Phpunit(runner) => runner.discover(args),
AvailableTestKind::NodeTest(runner) => runner.discover(args),
AvailableTestKind::Rspec(runner) => runner.discover(args),
}
}

Expand All @@ -48,6 +51,7 @@ impl Runner for AvailableTestKind {
AvailableTestKind::Vitest(runner) => runner.run_file_test(args),
AvailableTestKind::Phpunit(runner) => runner.run_file_test(args),
AvailableTestKind::NodeTest(runner) => runner.run_file_test(args),
AvailableTestKind::Rspec(runner) => runner.run_file_test(args),
}
}

Expand All @@ -61,6 +65,7 @@ impl Runner for AvailableTestKind {
AvailableTestKind::Vitest(runner) => runner.detect_workspaces(args),
AvailableTestKind::Phpunit(runner) => runner.detect_workspaces(args),
AvailableTestKind::NodeTest(runner) => runner.detect_workspaces(args),
AvailableTestKind::Rspec(runner) => runner.detect_workspaces(args),
}
}
}
Expand All @@ -78,6 +83,7 @@ impl FromStr for AvailableTestKind {
"deno" => Ok(AvailableTestKind::Deno(DenoRunner)),
"phpunit" => Ok(AvailableTestKind::Phpunit(PhpunitRunner)),
"node-test" => Ok(AvailableTestKind::NodeTest(NodeTestRunner)),
"rspec" => Ok(AvailableTestKind::Rspec(RspecRunner)),
_ => Err(anyhow::anyhow!("Unknown test kind: {}", s)),
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/adapter/src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ pub mod deno;
pub mod go;
pub mod jest;
pub mod phpunit;
pub mod rspec;
pub mod util;
pub mod vitest;
2 changes: 1 addition & 1 deletion crates/adapter/src/runner/phpunit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fn discover(file_path: &str) -> Result<Vec<TestItem>, LSError> {
) @test.definition
))
"#;
discover_with_treesitter(file_path, &tree_sitter_php::language_php(), query)
discover_with_treesitter(file_path, &tree_sitter_php::language(), query) // Changed language_php() to language()
}

#[derive(Eq, PartialEq, Debug)]
Expand Down
Loading
Loading