Skip to content

Commit

Permalink
Enable wasm compatibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Oct 10, 2024
1 parent 8d0f58f commit a8f007a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
target: [ 'jvm', 'js', 'native' ]
target: [ 'jvm', 'js', 'wasm', 'native' ]
include:
- os: 'macos-latest'
target: 'macos'
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
target: [ 'jvm', 'js', 'native' ]
target: [ 'jvm', 'js', 'wasm', 'native' ]
include:
- os: 'macos-latest'
target: 'macos'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/run-tests-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
target: [ 'jvmAll', 'js', 'native' ]
target: [ 'jvmAll', 'js', 'wasm', 'native' ]
include:
- os: 'macos-latest'
target: 'wasm'
- os: 'macos-latest'
target: 'macos'
- os: 'macos-latest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,18 @@ abstract class CompatibilityTest<A : CryptographyAlgorithm>(
abstract suspend fun CompatibilityTestScope<A>.generate(isStressTest: Boolean)
abstract suspend fun CompatibilityTestScope<A>.validate()

@WasmIgnore
@Test
fun generateStep() = testWithAlgorithm {
val logger = logger.child("GENERATE")
runCompatibilityTestStep(logger, ServerApi(algorithmId.name, context, logger)) { generate(isStressTest = false) }
}

@WasmIgnore
@Test
fun generateStressStep() = testWithAlgorithm {
val logger = logger.child("GENERATE")
runCompatibilityTestStep(logger, ServerApi(algorithmId.name, context, logger)) { generate(isStressTest = true) }
}

@WasmIgnore
@Test
fun validateStep() = testWithAlgorithm {
val logger = logger.child("VALIDATE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,3 @@ fun Buffer.bufferedSource(): Source = (this as RawSource).buffered()
fun Buffer.bufferedSink(): Sink = (this as RawSink).buffered()

expect fun disableJsConsoleDebug()

// Wasm tests on browser cannot be filtered: https://youtrack.jetbrains.com/issue/KT-58291
@OptIn(ExperimentalMultiplatform::class)
@OptionalExpectation
expect annotation class WasmIgnore()
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

package dev.whyoleg.cryptography.providers.tests.api

import kotlin.test.*

actual typealias WasmIgnore = Ignore

internal actual val currentTestPlatform: TestPlatform = jsPlatform().run {
when {
isNode -> TestPlatform.WasmJs.NodeJS(
Expand Down

0 comments on commit a8f007a

Please sign in to comment.