* Add WebDriverClient for headless testing
* Launch new session with headless arg by default
* Add --headless option in carton test
* Improve logging message
* Apply formatter for WebDriverClient module
* Support MS Edge
* Add headless testing test
* Explicitly depend on NIOFoundationCompat
* Avoid public actor field as a 5.5 compiler crash workaround
* Add --headless description in README.md
* Update Sources/CartonCLI/Commands/Test.swift
Co-authored-by: Max Desiatov <max@desiatov.com>
* Apply suggestions from code review for wording
Co-authored-by: Max Desiatov <max@desiatov.com>
* Rename failedToFindDriver -> failedToFindWebDriver
* Rephrase diagnostic message
* Omit explicit internal keyword
* Remove unused goto.Response struct
* Add license header to Tests/WebDriverClientTests/WebDriverClientTests.swift
Co-authored-by: Max Desiatov <max@desiatov.com>
Co-authored-by: Max Desiatov <max@desiatov.com>
I am trying to implement an `esbuild` plugin that calls into `carton`. My plan was to call `carton bundle --debug` to get a quick development build and then extract that command's output for use in our esbuild project.
Unfortunately, `carton bundle` still runs `wasm-opt` even on a debug build, which takes 5-10s for our project. The only alternative I can see is `carton dev`, but that runs the dev server / watcher, which we don't want either for a one-off build.
Since changing the behaviour of `carton bundle --debug` to _not_ run `wasm-opt` may cause issues with backwards compatibility, @MaxDesiatov suggested we add a command line option `--wasm-optimizations {size, none}` instead, allowing users to specifically opt out of this behaviour.
* Add --skip-build option to carton test to delegate building to users
* Add test case for --skip-build
* Rename --skip-build to --bundle-path to allow specifying binary path
* Update Sources/CartonCLI/Commands/Test.swift
Co-authored-by: Max Desiatov <max@desiatov.com>
* Rename --bundle-path to --prebuilt-test-bundle-path
* Update Sources/CartonCLI/Commands/Test.swift
Co-authored-by: Max Desiatov <max@desiatov.com>
Co-authored-by: Max Desiatov <max@desiatov.com>
After switching to `async`/`await` the value of `isBuildCurrentlyRunning` wasn't correctly reset, which led to issues. By resetting the variable in `defer` we guarantee that it will be reset even when errors are thrown.
Resolves#339.
* Use JSKit runtime from SwiftPM resources
* Fix Node.js test runner
* Remove unused webpack npm packages
* Update Swift version in `.swiftformat`
* Fix browser and Node.js CJS/ESM handling
* Fix one of the tests, add CI time limit
* Use Tokamak `update-jskit` branch to fix tests
* Use latest Vapor with `.mjs` content-type fix
* Use dynamic import to detect JSKit presence
* Fix missing `runtimeConstructor` reference
* Update `StaticArchive.swift`
* Reduce the diff
* Address PR feedback
* Fix Node.js <-> JSKit integration test
* Update SwiftPM dependencies
* Fix comment typo in `testNode.js`
* Reuse `__stack_sanitizer` across entrypoints
### 🎩 What is the goal?
Implement NodeJS as another test runner.
### 📄 How is it being implemented?
In this PR, I include the following changes:
- Create an abstraction for the different Test Runners (Wasmer, browser and now Node)
- Implement the new Node test runner (quite similar to the Wasmer one)
- Unify Javascript client code, so we can make sure we apply the same patches and load in the same way all the different targets
- Create a new entry point for testing with node
- Add that new entry point to the static bundle
### 👀 Any consideration?
The Node test runner does not use the TestsParser as it heavily impacts execution time. I will try to figure out what's going on later.
### ✅ How can it be tested?
Testing is automated 🤖 . You can also check this in your own project by running:
```bash
carton test --environment node
```
There are issues with binding 0.0.0.0 address on macOS 12, I'm dropping the corresponding argument from tests in f24d39e8f8. Also seeing issues with Ubuntu 18.04, even though all tests seem to be passing. Dropping it as an old version from CI as well.
This makes our codebase smaller by ~80 lines and arguably more readable. Also removes OpenCombine dependency.
* Use `async`/`await` and actors instead of Combine
* Remove OpenCombine dependency
* Fix progress animation not updated
* Stop building with Swift 5.4, clean up terminal output
* Update requirements in `README.md`
* Add `description` to `InvalidResponseCode`
* Fix Linux build error
* Rename `main.swift` to `Main.swift`
* Work around IR/TDB warnings
* Pass IR/TDB arguments correctly to `swift build`
* Support `async` process runner in `carton-release`
* Use Xcode 13.2.1 on macOS
* Pass TDB/IR flags to `swift test` as well
* Make `Install` command async
* Add doc comments, handle subsequent rebuilds
`async-http-client` package is now pinned to 1.6.4, as 1.7.0 and later versions caused issues with toolchain downloads (see https://github.com/swift-server/async-http-client/issues/488 for more details).
I've also updated toolchain downloader code to bubble up download errors, which previously were hidden and made it very hard to diagnose these issues.
* Use SwiftWasm 5.5.0, bump version to 0.12.0
* Pin AHC to 1.8.0
* Pin AHC to 1.6.4, always remove downloaded archives
* Fix `defer` build issue
I've dropped support for Swift 5.2, and SwiftLint now requires Xcode 12.5.1, which is unavailable on macOS 10.15 with GitHub Actions. This makes it impossible to test with Swift 5.3 on CI, so I'm bumping the required version to Swift 5.4.
Resolves https://github.com/swiftwasm/carton/issues/262.
* Update dependencies, add support for SwiftWasm 5.5
* Bump dependencies in `.github/workflows/swift.yml`
* Add explicit dependency on `NIOFoundationCompat`
* Lower Splash version to 0.15 for Swift 5.3 compat
* Update DefaultToolchain.swift
* Update swift.yml
* Revert "Lower Splash version to 0.15 for Swift 5.3 compat"
This reverts commit 6e04a7f158.
* Require Swift 5.4 in `Package.swift`
* Update README.md
* Use older 5.5 snapshot, unblock tests on failure
* Update DefaultToolchain.swift
* Select correct CPU architecture when downloading
* Disable hanging test
* Use latest 5.5 toolchain
* Use 2021-11-16 snapshot of SwiftWasm 5.5
* Add missing linker flags, re-enable browser test
* Address PR feedback
The `DestinationEnvironment` was not correctly detected from the `User-Agent` header of a WebSocket connection, always resulted in `.other`. This disabled any stack trace demangling.
Fixes#248.
* Add failing test for DestinationEnvironment.init?()
* Fix environment detection from User-Agent header