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

basic websocket integration test #87

Merged
merged 19 commits into from
Nov 10, 2023
Merged
29 changes: 28 additions & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ jobs:
- name: Install Test Dependencies
run: |
pip install --upgrade web3
pip install otree
apt install -y wget
wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz
tar xvfJ node-v18.17.0-linux-x64.tar.xz
Expand All @@ -347,10 +348,36 @@ jobs:
cd test_run_root
${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-miner ${{ steps.eos-evm-miner-build.outputs.EVM_MINER_ROOT }}

- name: Test Web-Socket Integration
run: |
echo "=== current directory is $(pwd)==="
apt-get install psmisc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The apt-get command would ideally be moved to the ubuntu22.Dockerfile.

killall -9 nodeos || true
killall -9 eos-evm-node || true
killall -9 eos-evm-rpc || true
sleep 1.0
mkdir -p ws_test_run_root
cd ws_test_run_root
pip install --upgrade web3
pip install otree
pip install websocket-client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, these pip install commands would be moved to the ubuntu22.Dockerfile.

pushd ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}
cd peripherals/eos-evm-ws-proxy
npm install env
npm install dotenv
npm install winston
npm install ws
npm install uuid
npm install axios
npm install web3
npm install collections
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, installing these packages globally with npm in the ubuntu22.Dockerfile would be preferred.

popd
${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_ws_test_basic.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}

- name: Prepare Logs
if: failure()
run: |
tar -czf leap-int-test-logs.tar.gz test_run_root/*
tar -czf leap-int-test-logs.tar.gz test_run_root/* ws_test_run_root/*

- name: Upload logs from failed tests
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ endif()
add_subdirectory(external)
add_subdirectory(version)
add_subdirectory(src)
add_subdirectory(peripherals)
add_subdirectory(tests)
2 changes: 2 additions & 0 deletions peripherals/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory( eos-evm-ws-proxy )

7 changes: 7 additions & 0 deletions peripherals/eos-evm-ws-proxy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
configure_file( block-monitor.js . COPYONLY )
configure_file( utils.js . COPYONLY )
configure_file( subscription-server.js . COPYONLY )
configure_file( main.js . COPYONLY )
configure_file( logger.js . COPYONLY )
configure_file( config.js . COPYONLY )
configure_file( websocket-handler.js . COPYONLY )
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_subdirectory( nodeos_eos_evm_server )

configure_file(antelope_name.py . COPYONLY)
configure_file(nodeos_eos_evm_ws_test_basic.py . COPYONLY)
configure_file(nodeos_eos_evm_server.py . COPYONLY)
configure_file(nodeos_eos_evm_test.py . COPYONLY)
Loading