Skip to content

Commit

Permalink
some polish (#1476)
Browse files Browse the repository at this point in the history
* fixes #1477
* update changelog
* update wstest
* add GH actions workflow for wstest
  • Loading branch information
oberstet committed Mar 17, 2021
1 parent 7d4e812 commit aa0e268
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 169 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/wstest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# runs autobahn testsuite and uploads to
# https://crossbario.com/reports/autobahn-testsuite-2021-03-17/clients/index.html

name: wstest

on:
# Trigger this workflow when the "deploy" workflow has completed successfully
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_run
workflow_run:
workflows:
- deploy
branches:
- master
types:
- completed

jobs:

# runs on x86-64 (xeon-d) host: matterhorn
wstest_amd64:

if: github.ref == 'refs/heads/master'

runs-on: [self-hosted, linux, X64]

strategy:
matrix:
python-version: ['3.9', 'pypy-3.7']

env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}

steps:
# Checkout sources
- uses: actions/checkout@v2

# Install OS packages, as we install Python packages from source:
#
# libenchant-dev needed for pyenchant, needed for sphinx-spellcheck
# libbz2-dev, libsnappy-dev needed for compression
# libunwind-dev needed for vmprof
#
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install build-essential libssl-dev libffi-dev libunwind-dev \
libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
libsnappy-dev
# Use this Python
# https://github.com/actions/setup-python/blob/main/README.md
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Set environment
run: |
echo AUTOBAHN_BUILD_DATE=`date -u +"%Y-%m-%d"` >> $GITHUB_ENV
echo AUTOBAHN_BUILD_ID=$(date --utc +%Y%m%d)-$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV
echo AUTOBAHN_VCS_REF=`git rev-parse --short ${GITHUB_SHA}` >> $GITHUB_ENV
echo AUTOBAHN_VERSION=$(grep -E '^(__version__)' ./autobahn/_version.py | cut -d ' ' -f3 | sed -e 's|[u"'\'']||g') >> $GITHUB_ENV
- name: Print environment
run: |
echo ""
echo "Build environment configured:"
echo ""
echo " AUTOBAHN_BUILD_DATE = ${AUTOBAHN_BUILD_DATE}"
echo " AUTOBAHN_BUILD_ID = ${AUTOBAHN_BUILD_ID}"
echo " AUTOBAHN_VCS_REF = ${AUTOBAHN_VCS_REF}"
echo " AUTOBAHN_VERSION = ${AUTOBAHN_VERSION}"
echo ""
echo " AWS_DEFAULT_REGION = ${AWS_DEFAULT_REGION}"
echo " AWS_S3_BUCKET_NAME = ${AWS_S3_BUCKET_NAME}"
echo ""
- name: Install Python package dependencies
run: |
python -m pip install -U pip
pip install -U -r requirements-dev.txt
- name: Install this package
run: |
pip install .[all]
- name: Run a Docker container with the fuzzing server
run: |
cd wstest
make wstest_server_docker_pull
make wstest_server_docker_quick
sleep 5
python testee_client_tx.py
python testee_client_aio.py
make wstest_server_docker_stop
- name: Upload reports
run: |
aws s3 sync --delete --acl public-read --region=${AWS_DEFAULT_REGION} \
./wstest/reports/clients \
s3://crossbario.com/reports/websocket-testsuite/autobahn-${AUTOBAHN_VERSION}-${{ matrix.python-version }}
8 changes: 4 additions & 4 deletions autobahn/websocket/compress_deflate.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PerMessageDeflateMixin(object):
Name of this WebSocket extension.
"""

WINDOW_SIZE_PERMISSIBLE_VALUES = [8, 9, 10, 11, 12, 13, 14, 15]
WINDOW_SIZE_PERMISSIBLE_VALUES = [9, 10, 11, 12, 13, 14, 15]
"""
Permissible value for window size parameter.
Higher values use more memory, but produce smaller output. The default is 15.
Expand Down Expand Up @@ -106,7 +106,7 @@ def parse(cls, params):
# 8.1.2.2. client_max_window_bits

# ".. This parameter has no value or a decimal integer value without
# leading zeroes between 8 to 15 inclusive ..""
# leading zeroes between 9 to 15 inclusive ..""

# noinspection PySimplifyBooleanCheck
if val is not True:
Expand Down Expand Up @@ -172,7 +172,7 @@ def __init__(self,
:param request_no_context_takeover: When ``True``, the client request the "no context takeover" feature.
:type request_no_context_takeover: bool
:param request_max_window_bits: When non-zero, the client requests the given "max window size" (must be
and integer from the interval ``[8..15]``).
and integer from the interval ``[9..15]``).
:type request_max_window_bits: int
"""
if type(accept_no_context_takeover) != bool:
Expand Down Expand Up @@ -258,7 +258,7 @@ def __init__(self,
:param request_no_context_takeover: When ``True``, the server requests the "no context takeover" feature.
:type request_no_context_takeover: bool
:param request_max_window_bits: When non-zero, the server requests the given "max window size" (must be
and integer from the interval ``[8..15]``).
and integer from the interval ``[9..15]``).
:param request_max_window_bits: int
:param no_context_takeover: Override server ("server-to-client direction") context takeover (this must
be compatible with the offer).
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog
master
------

* fix: WebSocket compression, window size (zlib wbits) == 8 is illegal nowerdays (#1477)
* fix: XBR IDL code generator - all 4 WAMP actions working now
* new: add automated build of xbrnetwork CLI (single-file EXE) in CI

Expand Down
16 changes: 9 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ envlist =
sphinx

# CPython
py37-{tw189,tw1910,tw203,twtrunk,asyncio}
py38-{tw189,tw1910,tw203,twtrunk,asyncio}
py39-{tw189,tw1910,tw203,twtrunk,asyncio}
py37-{tw189,tw1910,tw203,tw212,twtrunk,asyncio}
py38-{tw189,tw1910,tw203,tw212,twtrunk,asyncio}
py39-{tw189,tw1910,tw203,tw212,twtrunk,asyncio}

# PyPy
pypy37-{tw189,tw1910,tw203,twtrunk,asyncio}
pypy37-{tw189,tw1910,tw203,tw212,twtrunk,asyncio}


# MAP: GitHub Actions Python Name => Tox Env Name (for Python)
Expand Down Expand Up @@ -41,9 +41,11 @@ deps =
tw189: twisted==18.9.0
tw1910: twisted==19.10.0
tw203: twisted==20.3.0
tw212: twisted==21.2.0

# twtrunk: https://github.com/twisted/twisted/archive/trunk.zip
twtrunk: git+https://github.com/twisted/twisted
{tw189,tw1910,tw203,twtrunk}: pytest-twisted
{tw189,tw1910,tw203,tw212,twtrunk}: pytest-twisted

; asyncio dependencies
asyncio: pytest_asyncio
Expand Down Expand Up @@ -88,7 +90,7 @@ setenv =
# controls test setup according to networking framework
asyncio: USE_ASYNCIO=1
asyncio: PYTHONPATH={toxinidir}
tw189,tw1910,tw203,twtrunk: USE_TWISTED=1
tw189,tw1910,tw203,tw212,twtrunk: USE_TWISTED=1

# this enables "autobahn/test/test_rng.py" (on Linux),
# which tests entropy depletion, and tests how to correctly
Expand All @@ -103,7 +105,7 @@ commands =
# pip install -q --no-cache --ignore-installed --force-reinstall .[twisted,asyncio,compress,serialization,encryption,scram,xbr]

asyncio: pytest -s -v --ignore=./autobahn/twisted ./autobahn
tw189,tw1910,tw203: trial ./autobahn
tw189,tw1910,tw203,tw212: trial ./autobahn
twtrunk: python -m twisted.trial ./autobahn


Expand Down

0 comments on commit aa0e268

Please sign in to comment.