Skip to content

Commit e34d561

Browse files
committed
test: fix e2e tests
1 parent 04aded4 commit e34d561

3 files changed

Lines changed: 27 additions & 27 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ pyo3-build-config = { version = "0.28", optional = true }
7676
pyo3-introspection = { version = "0.28", optional = true }
7777

7878
[features]
79-
default = ["lua-jit", "py-abi3", "py-extmod", "test-coverage"]
79+
default = ["lua-jit", "py-abi3", "py-extmod"]
8080
proto = ["dep:codemp-proto"]
8181
client = ["proto", "dep:tonic", "dep:tokio", "dep:tokio-stream", "dep:dashmap", "codemp-proto?/client"]
8282
server = ["proto", "codemp-proto?/server"]
8383
# extra
8484
async-trait = ["dep:async-trait"]
8585
serialize = ["dep:serde", "uuid?/serde"]
8686
# special tests which require more setup
87-
test-e2e = ["dep:uuid"]
87+
test-e2e = ["client", "dep:uuid"]
8888
test-coverage = ["dep:syn", "dep:regex"]
8989
# ffi
9090
java = ["client", "dep:jni", "dep:tracing-subscriber", "dep:jni-toolbox", "codemp-proto/java"]

src/tests/coverage/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(missing_docs)] // internal test helper
1+
#![allow(missing_docs, clippy::unwrap_used)] // internal test helper
22

33
use std::collections::{BTreeMap, BTreeSet};
44

src/tests/e2e/fixtures.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ impl ClientFixture {
5757
}
5858
}
5959

60-
impl ScopedFixture<crate::Client> for ClientFixture {
61-
async fn setup(&mut self) -> Result<crate::Client, Box<dyn Error>> {
60+
impl ScopedFixture<crate::Session> for ClientFixture {
61+
async fn setup(&mut self) -> Result<crate::Session, Box<dyn Error>> {
6262
let upper = self.name.to_uppercase();
6363
let username = self.username.clone().unwrap_or_else(|| {
6464
std::env::var(format!("CODEMP_TEST_USERNAME_{upper}")).unwrap_or_default()
6565
});
6666
let password = self.password.clone().unwrap_or_else(|| {
6767
std::env::var(format!("CODEMP_TEST_PASSWORD_{upper}")).unwrap_or_default()
6868
});
69-
let client = crate::Client::connect(crate::api::Config {
69+
let client = crate::Session::connect(crate::api::Config {
7070
username,
7171
password,
7272
tls: Some(false),
@@ -110,15 +110,15 @@ impl WorkspaceFixture {
110110
}
111111
}
112112

113-
impl ScopedFixture<(crate::Client, crate::Workspace)> for WorkspaceFixture {
114-
async fn setup(&mut self) -> Result<(crate::Client, crate::Workspace), Box<dyn Error>> {
113+
impl ScopedFixture<(crate::Session, crate::Workspace)> for WorkspaceFixture {
114+
async fn setup(&mut self) -> Result<(crate::Session, crate::Workspace), Box<dyn Error>> {
115115
let client = ClientFixture::of(&self.user).setup().await?;
116116
client.create_workspace(self.workspace.to_string()).await?;
117117
let workspace = client.attach_workspace(&self.user, &self.workspace).await?;
118118
Ok((client, workspace))
119119
}
120120

121-
async fn cleanup(&mut self, resource: Option<(crate::Client, crate::Workspace)>) {
121+
async fn cleanup(&mut self, resource: Option<(crate::Session, crate::Workspace)>) {
122122
if let Some((client, workspace)) = resource {
123123
client.leave_workspace(&client.current_user().name, &workspace.id().workspace);
124124
if let Err(e) = client.delete_workspace(self.workspace.clone()).await {
@@ -130,19 +130,19 @@ impl ScopedFixture<(crate::Client, crate::Workspace)> for WorkspaceFixture {
130130

131131
impl
132132
ScopedFixture<(
133-
crate::Client,
133+
crate::Session,
134134
crate::Workspace,
135-
crate::Client,
135+
crate::Session,
136136
crate::Workspace,
137137
)> for WorkspaceFixture
138138
{
139139
async fn setup(
140140
&mut self,
141141
) -> Result<
142142
(
143-
crate::Client,
143+
crate::Session,
144144
crate::Workspace,
145-
crate::Client,
145+
crate::Session,
146146
crate::Workspace,
147147
),
148148
Box<dyn Error>,
@@ -173,9 +173,9 @@ impl
173173
async fn cleanup(
174174
&mut self,
175175
resource: Option<(
176-
crate::Client,
176+
crate::Session,
177177
crate::Workspace,
178-
crate::Client,
178+
crate::Session,
179179
crate::Workspace,
180180
)>,
181181
) {
@@ -226,24 +226,24 @@ impl BufferFixture {
226226

227227
impl
228228
ScopedFixture<(
229-
crate::Client,
229+
crate::Session,
230230
crate::Workspace,
231-
crate::buffer::Controller,
232-
crate::Client,
231+
crate::client::buffer::Controller,
232+
crate::Session,
233233
crate::Workspace,
234-
crate::buffer::Controller,
234+
crate::client::buffer::Controller,
235235
)> for BufferFixture
236236
{
237237
async fn setup(
238238
&mut self,
239239
) -> Result<
240240
(
241-
crate::Client,
241+
crate::Session,
242242
crate::Workspace,
243-
crate::buffer::Controller,
244-
crate::Client,
243+
crate::client::buffer::Controller,
244+
crate::Session,
245245
crate::Workspace,
246-
crate::buffer::Controller,
246+
crate::client::buffer::Controller,
247247
),
248248
Box<dyn Error>,
249249
> {
@@ -288,12 +288,12 @@ impl
288288
async fn cleanup(
289289
&mut self,
290290
resource: Option<(
291-
crate::Client,
291+
crate::Session,
292292
crate::Workspace,
293-
crate::buffer::Controller,
294-
crate::Client,
293+
crate::client::buffer::Controller,
294+
crate::Session,
295295
crate::Workspace,
296-
crate::buffer::Controller,
296+
crate::client::buffer::Controller,
297297
)>,
298298
) {
299299
if let Some((client, ws, _, _, _, _)) = resource {

0 commit comments

Comments
 (0)