Skip to content

Commit

Permalink
Merge pull request #64 from hexedtech/test/e2e
Browse files Browse the repository at this point in the history
test/e2e
  • Loading branch information
zaaarf authored Nov 5, 2024
2 parents 9d458f6 + e25b82a commit 1a2542a
Show file tree
Hide file tree
Showing 9 changed files with 907 additions and 29 deletions.
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

0 comments on commit 1a2542a

Please sign in to comment.