Skip to content

Commit

Permalink
Merge pull request #87 from eosnetworkfoundation/kayan_ws_test
Browse files Browse the repository at this point in the history
basic websocket integration test
  • Loading branch information
taokayan authored Nov 10, 2023
2 parents 3f44ad9 + e200771 commit 969f754
Show file tree
Hide file tree
Showing 6 changed files with 834 additions and 1 deletion.
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
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
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
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

0 comments on commit 969f754

Please sign in to comment.