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

Fix USE_DIFFERENT_SESSION use #18

Merged
merged 1 commit into from
Feb 16, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
- name: test
run: mix test --warnings-as-errors --cover

test-with-two-session:
test-with-another-session:
needs: build-deps
runs-on: ubuntu-latest

Expand All @@ -144,4 +144,4 @@ jobs:
restore-keys: deps-${{ runner.os }}-${{ steps.setup-beam.outputs.otp-version }}-${{ steps.setup-beam.outputs.elixir-version }}-

- name: test
run: USE_DIFFERENT_SESSION="" mix test --warnings-as-errors --cover
run: USE_DIFFERENT_SESSION="1" mix test --warnings-as-errors --cover
6 changes: 3 additions & 3 deletions test/support/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ defmodule Zenohex.Test.Utils do
@moduledoc false

def maybe_different_session(session) do
if is_nil(System.get_env("USE_DIFFERENT_SESSION")) do
session
else
if System.get_env("USE_DIFFERENT_SESSION") == "1" do
Zenohex.open!()
else
session
end
end
end
2 changes: 1 addition & 1 deletion test/zenohex/examples/publisher_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule Zenohex.Examples.PublisherTest do

assert Publisher.delete() == :ok

if System.get_env("USE_DIFFERENT_SESSION") do
if System.get_env("USE_DIFFERENT_SESSION") == "1" do
# Zenoh 0.10.1-rc has the bug, https://github.com/eclipse-zenoh/zenoh/issues/633
# This bug causes that `delete` creates the Sample whose kind is :put.
# FIXME: when update Zenoh from 0.10.1-rc to over
Expand Down
2 changes: 1 addition & 1 deletion test/zenohex/examples/pull_subscriber_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule Zenohex.Examples.PullSubscriberTest do
# When using same session, Zenoh pull subscriber can get Sample before pulling.
# But using different session, Zenoh pull subscriber can not.
# This might be a Zenoh bug.
@tag System.get_env("USE_DIFFERENT_SESSION") && :skip
@tag System.get_env("USE_DIFFERENT_SESSION") == "1" && :skip
test "start_link/1", %{session: session} do
Zenohex.Session.put(session, "key/expression/put", "put")

Expand Down