mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-23 15:27:28 +02:00
websocket: updated example to use local websocket echo server
This commit is contained in:
8
.github/workflows/target-test.yml
vendored
8
.github/workflows/target-test.yml
vendored
@ -193,7 +193,7 @@ jobs:
|
||||
components/esp_websocket_client/examples/build/config/sdkconfig.json
|
||||
if-no-files-found: error
|
||||
|
||||
run-target:
|
||||
run-target-websocket:
|
||||
name: Run Websocket Example Test on target
|
||||
needs: build_websocket
|
||||
strategy:
|
||||
@ -206,9 +206,6 @@ jobs:
|
||||
- ESP32-ETHERNET-KIT
|
||||
# Skip running on forks since it won't have access to secrets
|
||||
if: github.repository == 'espressif/esp-protocols'
|
||||
container:
|
||||
image: python:3.7-buster
|
||||
options: --privileged # Privileged mode has access to serial ports
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v2
|
||||
@ -225,8 +222,7 @@ jobs:
|
||||
- name: Run Example Test on target
|
||||
working-directory: components/esp_websocket_client/examples
|
||||
run: |
|
||||
cp sdkconfig.ci sdkconfig.defaults
|
||||
pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }}
|
||||
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
|
@ -101,7 +101,7 @@ def test_examples_protocol_websocket(dut):
|
||||
data = json.loads(json_string)
|
||||
|
||||
match = dut.expect(
|
||||
re.compile(b'Json=([a-zA-Z0-9]*).*')).group(0).decode()[5:]
|
||||
re.compile(b'Json=({[a-zA-Z0-9]*).*}')).group(0).decode()[5:]
|
||||
if match == str(data[0]):
|
||||
print('Sent message and received message are equal')
|
||||
else:
|
||||
@ -122,7 +122,7 @@ def test_examples_protocol_websocket(dut):
|
||||
recv_msg = ''
|
||||
while len(recv_msg) < msg_len:
|
||||
match = dut.expect(re.compile(
|
||||
b'Received=([a-zA-Z0-9]*).*')).group(1).decode()
|
||||
b'Received=([a-zA-Z0-9]*).*\n')).group(1).decode()
|
||||
recv_msg += match
|
||||
|
||||
if recv_msg == send_msg:
|
||||
|
@ -1,6 +1,5 @@
|
||||
CONFIG_WEBSOCKET_URI_FROM_STDIN=n
|
||||
CONFIG_WEBSOCKET_URI_FROM_STRING=y
|
||||
CONFIG_WEBSOCKET_URI="ws://echo.websocket.events"
|
||||
CONFIG_WEBSOCKET_URI_FROM_STDIN=y
|
||||
CONFIG_WEBSOCKET_URI_FROM_STRING=n
|
||||
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
|
||||
CONFIG_EXAMPLE_CONNECT_WIFI=n
|
||||
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
|
||||
|
Reference in New Issue
Block a user