Skip to content

Commit

Permalink
Autobahn test validation (#2)
Browse files Browse the repository at this point in the history
* passes autobahn test suite

* undo forced library version changes

* update buffer and socket library

* ktlint

* update ktlint and kotlin multiplatform

* hopefully this fixes the build

* podspec was updated

* remove unnessesary null assertion

* no need to publish the reports

* update android, enable default tests, have websockets lib contain it's own coroutine scope

* ktlint format

* kick off new build. there is some podspec change, so lets see if that helps

* increase timeouts

* update deps, remove tvosSimulatorArm64 and the specific device for iosSimulatorArm64 tests

* update ci to split ubuntu and macos
fix browser tests

* increase timeouts

* add timeout + autobahn tests (should be ignored for now)

* pass coroutine scope into autobahn tests

* ignore alltypes work test

* format

* lower timeout and launch the writes async

* launch clientEchoReadBuffer

* update socket module.
use macos for the android emulator runner
simplify android emulator runner

* undo simplification of the avd

* add autobahn tests

* format + bail autobahn check if directory doesn't exist

* install docker on mac osx

* better error messages

* more useful error messages on retry

* ktlint format again

* ensure JS tests execute while waiting for the coroutines to complete

* catch throwable for node error hopefully

* increase timeouts

* increase overall timeout on mocha

* temporarily ignore browser tests

* also ignore after test update

* ok tesls pass locally except for browser, lets see how the CI takes it

* ktlint format

* reduce timeout

* split up tests

* remove logs

* add command to launch docker image

* add startAutobahnDockerContainer

* ensure test dosnt execute if autobahn isn't running

* undo some changes

* ktlint format

* update tests and error reporting

* remove logs

* dont print stack trace

* simplify the hasremaining issue

* maybe simplify the test runner?

* increase timeout
  • Loading branch information
thebehera authored Feb 20, 2024
1 parent 9d1d811 commit 57e64a7
Show file tree
Hide file tree
Showing 43 changed files with 3,038 additions and 728 deletions.
10 changes: 10 additions & 0 deletions .docker/config/fuzzingserver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "ws://127.0.0.1:9001",
"outdir": "./reports/clients",
"cases": ["*"],
"exclude-cases": [
"12.*",
"13.*"
],
"exclude-agent-cases": {}
}
4 changes: 2 additions & 2 deletions .github/workflows/android_integration.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Android Emulator Integration Test"
on:
push:
branches: [ main ]
pull_request:
paths-ignore:
- '*.md'
types:
- synchronize
- opened
Expand Down
64 changes: 57 additions & 7 deletions .github/workflows/merged.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
name: "Build Test and Deploy"
on:
push:
paths-ignore:
- '*.md'
branches: [ main ]
env:
username: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
create-staging-repository:
name: Create staging repository
runs-on: ubuntu-latest
outputs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
run: |
jsonOutput=$(curl -s --request POST -u "$username:$password" \
--url https://oss.sonatype.org/service/local/staging/profiles/3abaab4608e7e/start \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "data": {"description" : "WebSocket"} }')
stagingRepositoryId=$(echo "$jsonOutput" | jq -r '.data.stagedRepositoryId')
if [ -z "$stagingRepositoryId" ]; then
echo "Error while creating the staging repository."
exit 1
else
echo "repository_id=$stagingRepositoryId" >> $GITHUB_OUTPUT
fi
macos:
name: MacOS Build & Upload artifacts to sonatype
needs: create-staging-repository
runs-on: macOS-latest
env:
SONATYPE_REPOSITORY_ID: ${{ needs.create-staging-repository.outputs.repository_id }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
Expand All @@ -33,8 +64,27 @@ jobs:
GPG_SECRET: ${{ secrets.GPG_SECRET }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: ./gradlew assemble build check ktlintCheck allTests publishAllPublicationsToSonatypeRepository publish closeAndReleaseRepository
run: ./gradlew publishAllPublicationsToSonatypeRepository
- uses: actions/upload-artifact@v3
with:
name: Package
path: build/libs
path: build/libs
finalize:
runs-on: ubuntu-latest
needs: [create-staging-repository, macos]
if: ${{ always() && needs.create-staging-repository.result == 'success' }}
steps:
- name: Discard
if: ${{ needs.macos.result != 'success' }}
uses: nexus-actions/drop-nexus-staging-repo@main
with:
username: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository-id }}
- name: Release
if: ${{ needs.macos.result == 'success' }}
uses: nexus-actions/release-nexus-staging-repo@main
with:
username: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository_id }}
15 changes: 13 additions & 2 deletions .github/workflows/review.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "Build and Test"
on:
pull_request:
paths-ignore:
- '*.md'
types:
- synchronize
- opened
Expand All @@ -9,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
os: [ macos-latest, ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
Expand All @@ -18,7 +20,16 @@ jobs:
distribution: 'zulu'
java-version: '19'
cache: gradle
- name: Setup docker (MacOS only)
if: runner.os == 'macos'
run: |
brew install docker
colima start
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Tests with Gradle
run: ./gradlew ktlintCheck assemble build check allTests publishToMavenLocal
run: ./gradlew startAutobahnDockerContainer ktlintCheck assemble build check allTests publishToMavenLocal
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ kotlinx-io-native/repo/
!.idea/runConfigurations
!.idea/codeStyles

local.properties
local.properties
/.docker/reports/clients/
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<p align="center">
A kotlin multiplatform library that allows you to connect a client websocket to websocket server.
<br />
Fully tested on all platforms using the extensive Autobahn test suite.
<!-- <a href="https://github.com/DitchOoM/websocket"><strong>Explore the docs »</strong></a> -->
<br />
<br />
Expand Down
Loading

0 comments on commit 57e64a7

Please sign in to comment.