Skip to content
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

test/e2e #64

Merged
merged 44 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5ee8773
test: added scoped fixtures and e2e tests
alemidev Oct 30, 2024
26bbd19
test: split down test stuff a bit
alemidev Oct 30, 2024
adaaf86
ci: run functional tests too
alemidev Oct 30, 2024
60b4c3d
fix(tests): test-e2e should not be on by default
alemidev Oct 30, 2024
e0c913b
ci(test): only run fn/build tests after unit
alemidev Oct 30, 2024
cb6c95e
ci(test): no toolchain matrix for fn tests
alemidev Oct 30, 2024
4772af4
ci: more fine-grained ci, less jobs
alemidev Oct 30, 2024
90568bb
test: ignored a test, fixed another
alemidev Oct 30, 2024
e0b919b
fix: more time in tryRecv to compensate longer RTT
alemidev Oct 30, 2024
752a682
ci(test): only run build tests after functional
alemidev Oct 30, 2024
cd4e09c
test: show for which test workspace was
alemidev Oct 30, 2024
111020a
test: buffer fixture
zaaarf Nov 2, 2024
7a535d4
test: workspace creation and lookup
ghyatzo Nov 3, 2024
dc627dc
fmt: formatter shenanigans
ghyatzo Nov 3, 2024
44e5e39
chore: implement from ConnectionError and from RemoteError for Assert…
ghyatzo Nov 3, 2024
9ff9a47
test: can't create workspace more than once
ghyatzo Nov 3, 2024
ccb5406
test: attaching to workspaces and making them active
ghyatzo Nov 3, 2024
fdd2726
test: attaching to a non existing workspace is an error
ghyatzo Nov 3, 2024
781fd9b
test: leaving workspaces, attaching after leaving
ghyatzo Nov 3, 2024
9d0c961
test: delete empty workspace
ghyatzo Nov 3, 2024
35b9b12
test: deleting twice or non existing is an error
ghyatzo Nov 3, 2024
84bfc45
test(WIP): added skeleton for testing of behaviour when deleting work…
ghyatzo Nov 3, 2024
7f17d1f
test: inviting users to one's workspace
ghyatzo Nov 3, 2024
3773ebf
test: moved around previously existing tests. and other formatter she…
ghyatzo Nov 3, 2024
c0bff45
fix(test): add more clear explainations of what went wrong.
ghyatzo Nov 3, 2024
518143d
docs(java): specify the new behaviour of leaveWorkspace
zaaarf Nov 3, 2024
c08e209
tests: cleanup redundant code
zaaarf Nov 3, 2024
c1c9dea
tests: actually delete the buffer in the buffer fixture
zaaarf Nov 3, 2024
888f7fd
docs: better wording in detach_buffer docs
zaaarf Nov 3, 2024
ee2ced5
chore: removed need of adding type hints
alemidev Nov 4, 2024
c42b091
test: better assert_or_err messages
alemidev Nov 4, 2024
300f662
fix: cleanup for buffer fixture
alemidev Nov 4, 2024
3f0b04a
feat(test): added fixture macro
alemidev Nov 4, 2024
2155f0d
test: improved tests cleanup and logic
alemidev Nov 4, 2024
59f9096
test: split lookup and create/delete tests
alemidev Nov 5, 2024
f350bc0
test: dont use is_ok(), propagate err
alemidev Nov 5, 2024
2e05c3d
test: split down invite_to_workspace_and_lookup
alemidev Nov 5, 2024
b58a11f
ci: just run on push
alemidev Nov 5, 2024
b549f82
test: even more time to disconnect?
alemidev Nov 5, 2024
ed0e05f
test: drop workspace so that it disconnects
alemidev Nov 5, 2024
bf9ea18
test: dont use ws fixture coz leave wont work
alemidev Nov 5, 2024
97ee486
test: wait 1s so it can catch up in case its slow
alemidev Nov 5, 2024
fb6e1cd
feat: use single tuple in buffer fixture too
zaaarf Nov 5, 2024
e25b82a
chore: cargo fmt
zaaarf Nov 5, 2024
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
68 changes: 44 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: test

on:
push:
pull_request:
types: [synchronize, review_requested]

env:
CARGO_TERM_COLOR: always
Expand All @@ -12,24 +10,25 @@ permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.runner }}
test-unit:
runs-on: ubuntu-latest
steps:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose

test-beta:
runs-on: ubuntu-latest
needs: [test-unit]
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest
- windows-latest
- macos-latest
features:
- java
- js
- py
- luajit
- lua54
toolchain:
- stable
- beta
- nightly
steps:
- uses: arduino/setup-protoc@v3
with:
Expand All @@ -38,22 +37,43 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo build --release --verbose --features=${{ matrix.features }}
- run: cargo test --verbose

test:
test-functional:
needs: [test-unit]
runs-on: ubuntu-latest
steps:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose --features=test-e2e
env:
CODEMP_TEST_USERNAME_ALICE: ${{ secrets.CODEMP_TEST_USERNAME_ALICE }}
CODEMP_TEST_PASSWORD_ALICE: ${{ secrets.CODEMP_TEST_PASSWORD_ALICE }}
CODEMP_TEST_USERNAME_BOB: ${{ secrets.CODEMP_TEST_USERNAME_BOB }}
CODEMP_TEST_PASSWORD_BOB: ${{ secrets.CODEMP_TEST_PASSWORD_BOB }}

test-build:
needs: [test-functional]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
runner:
- ubuntu-latest
- windows-latest
- macos-latest
features:
- java
- js
- py
- luajit
steps:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo test --verbose
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release --verbose --features=${{ matrix.features }}
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ default = []
# extra
async-trait = ["dep:async-trait"]
serialize = ["dep:serde", "uuid/serde"]
# special tests which require more setup
test-e2e = []
# ffi
java = ["lazy_static", "jni", "tracing-subscriber", "jni-toolbox"]
js = ["napi-build", "tracing-subscriber", "napi", "napi-derive"]
Expand Down
3 changes: 2 additions & 1 deletion dist/java/src/mp/code/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ public String[] activeWorkspaces() {
/**
* Leaves a workspace.
* @param workspaceId the id of the workspaces to leave
* @return true if it succeeded (usually fails if the workspace wasn't active)
* @return true if it succeeded or wasn't in the workspace; false if there are still
* leftover references around
*/
public boolean leaveWorkspace(String workspaceId) {
return leave_workspace(this.ptr, workspaceId);
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ pub mod ext;
/// language-specific ffi "glue"
pub mod ffi;

#[cfg(any(feature = "test-e2e", test))]
pub mod tests;

/// internal network services and interceptors
pub(crate) mod network;

Expand Down
Loading