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

Add hello world platform tests #332

Merged
merged 13 commits into from
Aug 14, 2024
38 changes: 38 additions & 0 deletions .circleci/continue-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,43 @@ parameters:
type: boolean
default: false

orbs:
rust: circleci/[email protected]

jobs:
hello_world_on_macos:
macos:
xcode: 14.2.0
resource_class: macos.m1.medium.gen1
steps:
- checkout
- rust/install
- run:
name: Run Hello world example
command: |
cargo run --example hello_world_publisher &
pid=$!
cargo run --example hello_world_subscriber
wait $pid
hello_world_on_windows:
machine:
image: 'windows-server-2019-vs2019:2024.05.1'
resource_class: windows.medium
shell: powershell.exe -ExecutionPolicy Bypass
steps:
- checkout
- run:
name: Install Rust
command: |
curl -o rustup.sh https://sh.rustup.rs
bash rustup.sh -y
- run:
name: Run Hello world example
command: |
$publisher = Start-Process cargo -ArgumentList 'run --example hello_world_publisher' -PassThru
cargo run --example hello_world_subscriber
$publisher.WaitForExit()

build_and_push_docker_image:
docker:
- image: cimg/base:current
Expand Down Expand Up @@ -288,6 +324,8 @@ workflows:
build_and_run_tests:
jobs:
- tests
- hello_world_on_macos
- hello_world_on_windows
- benchmark
- compilation_times
- clippy
Expand Down
96 changes: 48 additions & 48 deletions .github/workflows/interoperability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,51 @@ name: interoperability
on:
workflow_dispatch:

jobs:
interoperability:
name: OMG Interoperability
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Checkout dds-rtps
uses: actions/checkout@v4
with:
repository: omg-dds/dds-rtps
ref: '53803e70c00cbf60c816bb95c7886701ab9ae597'
path: omg-dds-rtps
sparse-checkout-cone-mode: false
sparse-checkout: |
interoperability_report.py
test_suite.py
rtps_test_utilities.py
requirements.txt
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --package dust_dds_shape_main_linux
- uses: actions/setup-python@v5
with:
python-version: '3.11.4'
- name: Downloads assets
uses: robinraju/[email protected]
with:
repository: omg-dds/dds-rtps
latest: true
fileName: "*"
- name: Unzip
run: unzip '*.zip' -d executables
- name: Setting up environment
run: pip install -r omg-dds-rtps/requirements.txt
- name: Publisher Dust - Subscriber Connext
run: python3 ./omg-dds-rtps/interoperability_report.py -P ./target/debug/dust_dds_shape_main_linux -S ./executables/connext_dds-*_shape_main_linux -o=report.xml
- name: Publisher Connext - Subscriber Dust
run: python3 ./omg-dds-rtps/interoperability_report.py -P ./executables/connext_dds-*_shape_main_linux -S ./target/debug/dust_dds_shape_main_linux -o=report.xml
- name: XUnit
uses: AutoModality/action-xunit-viewer@v1
with:
results: ./report.xml
fail: false
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: interoperability_report
path: ./index.html
jobs:
interoperability:
name: OMG Interoperability
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Checkout dds-rtps
uses: actions/checkout@v4
with:
repository: omg-dds/dds-rtps
ref: '53803e70c00cbf60c816bb95c7886701ab9ae597'
path: omg-dds-rtps
sparse-checkout-cone-mode: false
sparse-checkout: |
interoperability_report.py
test_suite.py
rtps_test_utilities.py
requirements.txt
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --package dust_dds_shape_main_linux
- uses: actions/setup-python@v5
with:
python-version: '3.11.4'
- name: Downloads assets
uses: robinraju/[email protected]
with:
repository: omg-dds/dds-rtps
latest: true
fileName: "*"
- name: Unzip
run: unzip '*.zip' -d executables
- name: Setting up environment
run: pip install -r omg-dds-rtps/requirements.txt
- name: Publisher Dust - Subscriber Connext
run: python3 ./omg-dds-rtps/interoperability_report.py -P ./target/debug/dust_dds_shape_main_linux -S ./executables/connext_dds-*_shape_main_linux -o=report.xml
- name: Publisher Connext - Subscriber Dust
run: python3 ./omg-dds-rtps/interoperability_report.py -P ./executables/connext_dds-*_shape_main_linux -S ./target/debug/dust_dds_shape_main_linux -o=report.xml
- name: XUnit
uses: AutoModality/action-xunit-viewer@v1
with:
results: ./report.xml
fail: false
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: interoperability_report
path: ./index.html
2 changes: 1 addition & 1 deletion dds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dust_dds_derive = { version = "0.10", path = "../dds_derive" }

md5 = "0.7.0" # Chose this crate over other possibilities since it doesn't have any other dependencies

socket2 = "0.5"
socket2 = { version = "0.5", features = ["all"] }
network-interface = "1.1.1"

fnmatch-regex = "0.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,8 @@ fn get_multicast_socket(
)?;

socket.set_reuse_address(true)?;
#[cfg(target_family = "unix")]
socket.set_reuse_port(true)?;
socket.set_nonblocking(false)?;
socket.set_read_timeout(Some(std::time::Duration::from_millis(50)))?;

Expand Down
Loading