Skip to content

Commit

Permalink
Add basic implementation without subscriptions (#5)
Browse files Browse the repository at this point in the history
* Change lib name

* Change to import spinify.old.dart

* Refactor code to remove @internal annotations and update imports

* Refactor code to remove @internal annotations and update imports

* Add basic event queue implementation

* Refactor code to remove @internal annotations and update imports

* Refactor code to remove @internal annotations and update imports

* Refactor code to remove @internal annotations and update imports

* Refactor code to update imports and remove @internal annotations

* Refactor code to update imports and remove @internal annotations

* Refactor code to update imports and remove @internal annotations

* Update sign-in form to remove unused code

* Update Makefile and Spinify code

* Update Makefile, centrifugo-config.json, Spinify code, and smoke_test.dart

* Add DevTools extension, set onDisconnect handler in transport_interface.dart, and use ping instead of send in smoke_test.dart

* Refactor SpinifyState class to use proper capitalization in type names

* Update centrifugo-config.json and smoke_test.dart

* Add echo server

* chore: Update .gitignore and add smoke_test.dart for test coverage

* Update echo server logic

* chore: Add slices package and update channelSubscribeAllowed function

* Update echo server logic and start server in detached mode

* chore: Update .vscode/tasks.json to use shared panel for task presentation

* Refactor ProtobufReplyDecoder to handle different reply types

* Handle ping messages

* Update expire time for authMiddleware to 25 seconds

* chore: Prolong connection lifetime with server-side callback

* Remove queue

* Add asserts

* chore: Improve error handling in SpinifyCommandMixin

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Reconnection

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyCommandMixin error handling and connection logic

* Add kMaxInt

* Refactor SpinifyCommandMixin error handling and connection logic

* Refactor SpinifyMetrics$Mutable class and add freeze() method

* Fix tests

* Add reconnection

* Add RPC method

* Refactor SpinifyTest to send 1000 requests instead of 100

* Refactor SpinifyTransportFake to handle different RPC methods

* Implement metrics

* dart2js and dart2wasm tests

* Refactor test command to increase request count to 1000

* Update code coverage
  • Loading branch information
PlugFox authored May 23, 2024
1 parent c2aac2a commit 8f29d14
Show file tree
Hide file tree
Showing 102 changed files with 13,099 additions and 411 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ jobs:
timeout-minutes: 1
run: dart analyze --fatal-infos --fatal-warnings lib/

#- name: 🧪 Run tests
# timeout-minutes: 2
# run: |
# dart run coverage:test_with_coverage -fb -o coverage -- \
# --concurrency=6 --platform vm --coverage=./coverage --reporter=expanded test/ws_test.dart
- name: 🧪 Run tests
timeout-minutes: 2
run: |
dart pub global activate coverage
dart pub global run coverage:test_with_coverage -fb -o coverage -- \
--platform vm --compiler=kernel --coverage=coverage \
--reporter=github --file-reporter=json:coverage/tests.json \
--timeout=30s --concurrency=12 --color \
test/unit_test.dart
#- name: 📥 Upload coverage to Codecov
# timeout-minutes: 1
# uses: codecov/codecov-action@v3
- name: 📥 Upload coverage to Codecov
timeout-minutes: 1
uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,17 @@ app.*.map.json
log.pana.json

# Test
coverage/
.coverage/
/test/**/*.json
/test/.test_coverage.dart

# Centifuge
config.json
centrifugo-config.json
config.json

# Golang

# Binaries for programs and plugins
*.exe
*.exe~
6 changes: 4 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"recommendations": ["dart-code.dart-code"]
}
"recommendations": [
"dart-code.dart-code",
]
}
130 changes: 125 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Example (lcl)",
"name": "[Flutter] Example (Local)",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
Expand All @@ -14,10 +14,12 @@
"console": "debugConsole",
"runTestsOnDevice": false,
"toolArgs": [],
"args": ["--dart-define-from-file=config/local.json"]
"args": [
"--dart-define-from-file=config/local.json"
]
},
{
"name": "Example (dev)",
"name": "[Flutter] Example (Development)",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
Expand All @@ -29,7 +31,125 @@
"console": "debugConsole",
"runTestsOnDevice": false,
"toolArgs": [],
"args": ["--dart-define-from-file=config/development.json"]
"args": [
"--dart-define-from-file=config/development.json"
]
},
// https://pub.dev/packages/test
// dart test test/unit_test.dart --color --platform=vm
{
"name": "[Dart] Unit test (VM)",
"request": "launch",
"type": "dart",
"program": "test/unit_test.dart",
"env": {
"ENVIRONMENT": "test"
},
"console": "debugConsole",
"runTestsOnDevice": false,
"templateFor": "test",
"toolArgs": [
"--color",
"--debug",
"--platform=vm",
"--compiler=kernel",
"--coverage=coverage",
"--reporter=expanded",
"--file-reporter=json:coverage/tests.json",
"--timeout=30s",
"--concurrency=12"
/* "--name=handles failed connection attempts" */
],
"args": []
},
// dart test test/unit_test.dart --color --platform=chrome
{
"name": "[Dart] Unit Test (dart2js)",
"request": "launch",
"type": "dart",
"program": "test/unit_test.dart",
"env": {
"ENVIRONMENT": "test"
},
"console": "debugConsole",
"runTestsOnDevice": false,
"templateFor": "test",
"toolArgs": [
"--color",
"--debug",
"--platform=chrome",
"--compiler=dart2js",
"--coverage=coverage",
"--reporter=expanded",
"--file-reporter=json:coverage/tests.json",
"--timeout=30s",
"--concurrency=12",
/* "--name=can send binary data" */
],
"args": []
},
{
"name": "[Dart] Unit Test (dart2wasm)",
"request": "launch",
"type": "dart",
"program": "test/unit_test.dart",
"env": {
"ENVIRONMENT": "test"
},
"console": "debugConsole",
"runTestsOnDevice": false,
"templateFor": "test",
"toolArgs": [
"--color",
"--debug",
"--platform=chrome",
"--compiler=dart2wasm",
"--coverage=coverage",
"--reporter=expanded",
"--file-reporter=json:coverage/tests.json",
"--timeout=30s",
"--concurrency=12",
/* "--name=can send binary data" */
],
"args": []
},
// dart test test/smoke_test.dart --color --platform=vm
{
"name": "[Dart] Smoke Test (VM)",
"request": "launch",
"type": "dart",
"program": "test/smoke_test.dart",
"env": {
"ENVIRONMENT": "test"
},
"console": "debugConsole",
"runTestsOnDevice": false,
"templateFor": "test",
"toolArgs": [
"--color",
"--debug",
"--coverage=coverage",
"--reporter=expanded",
"--platform=vm", // chrome
"--file-reporter=json:coverage/tests.json",
"--timeout=30s",
"--concurrency=12"
],
"args": [],
"preLaunchTask": "echo-server:start",
"postDebugTask": "echo-server:stop"
},
// dart run server/bin/server.dart
{
"name": "[Go] Echo Server",
"request": "launch",
"type": "go",
"program": "tool/echo/echo.go",
"cwd": "${workspaceFolder}/tool/echo",
"env": {
"ENVIRONMENT": "WebSocket Server"
},
"console": "internalConsole"
}
]
}
}
Loading

0 comments on commit 8f29d14

Please sign in to comment.