Skip to content

Commit

Permalink
Add Rust Test Agent (eclipse-uprotocol#23)
Browse files Browse the repository at this point in the history
* Add Rust Test Agent

* Add changes to TCK to support Rust Test Agent for Register_and_Send and register_and_unregister

Co-Authored-By: sagarsshah <157176449+sagarsshah@users.noreply.github.com>

* Review Comments from Pete

Sagar and I have taken in the comments from Pete's PR review and addressed most of them in this commit. Mainly:
* Refactored utils.rs
* Removed extension trait for utransport
* Aligned names to rust coding standard
* Ran rustfmt on all files
* Ran clippy on all files: we addressed most of the clippy issues, but some will require more intense refactoring
* Minor fixes and idiomatic cleanup

Co-Authored-By: sagarsshah <157176449+sagarsshah@users.noreply.github.com>

* Remove rust folder

Need to remove duplicate code that is no longer used.

* Librarify utransport_socket

Aligning the utransport_socket with recommendations from Pete. Instead of importing the utransport_socket.rs, we are now making it into a library crate.

* Resolve more comments

We went through the large majority of issues presented in the PR Review, including:
* removing almost all expects and unwraps
* changing many method names to match standards
* reduce size of many methods through simplification and reorganization

Notes for reviewer:
* One 'expect' remains [main.rs, line 71]. would appreciate advice on how to remove that
* One clippy error remains. It's regarding holding the socket across async calls.
* A few unwraps remain, but those are mostly handled except for one regarding commstatus

Co-Authored-By: sagarsshah <157176449+sagarsshah@users.noreply.github.com>

* Update for comments, add rust to spawn

Fix last clippy issue related to holding mutex across awaits (testagent.rs, line 225--)
Remove last expect for commstatus
Change wrapperu_message var name to wrapper_umessage
Add rust to new spawning paradigm in tck_step_implementations.py

* Few Comment resolutions

* Change dbg! to using log debug! crate.
* Changed "loop" in test agent to "while"
* Remove some comments

* Changes based on review

* update licenses
* remove get_ustatus_code
* add err_string to reuse error msgs
* change signature of parse_uauthority
* remove commented code
* formatting on lib.rs
* remove panic references since doesn't panic

Co-Authored-By: Pete LeVasseur <11622119+plevasseur@users.noreply.github.com>

* Few more comments

* Change specialfields to default
* Add "not implemented" to notification type
* Some fixes to debug msgs and comments

* Remove initialization of special_fields

* Remove special_fields from the uattributes deserializer

---------

Co-authored-by: Matthew D'Alonzo <matthew.dalonzo@gm.com>
Co-authored-by: sagarsshah <157176449+sagarsshah@users.noreply.github.com>
Co-authored-by: Pete LeVasseur <11622119+plevasseur@users.noreply.github.com>
  • Loading branch information
4 people authored May 15, 2024
1 parent 73b0376 commit c15d274
Show file tree
Hide file tree
Showing 19 changed files with 6,069 additions and 55 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/tck-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ permissions:
jobs:
run_tests:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
continue-on-error: true

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Rust Test Agent
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path test_agent/rust/Cargo.toml
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand All @@ -31,14 +37,15 @@ jobs:
working-directory: test_agent/java
run: |
mvn clean install --file pom.xml
- name: Set up Python 3.10
- name: Set up Python 3.8.7
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.8.7"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install multimethod
cd scripts
python install_dependencies.py
- name: Lint with flake8
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ MANIFEST
*.json
**/jar_files/**
*.jar
**/.DS_Store
**/.DS_Store
**/target
1 change: 1 addition & 0 deletions test_agent/rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit c15d274

Please sign in to comment.