Skip to content

Commit

Permalink
Debug failing tests in CI action
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkobor committed Oct 23, 2020
1 parent 43d7bb6 commit 5ea7762
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/*.gradle*') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-
${{ runner.os }}-gradle-
- name: Run Gradle check
run: ./gradlew check
run: ./gradlew check --info
- name: Codecov
uses: codecov/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package com.kuvaszuptime.kuvasz.services

import io.kotest.core.spec.style.DescribeSpec
import io.kotest.core.spec.style.StringSpec
import io.kotest.data.forAll
import io.kotest.data.headers
import io.kotest.data.row
import io.kotest.data.table
import io.kotest.matchers.booleans.shouldBeTrue
import java.net.URL
import kotlin.time.seconds

class SSLValidatorTest : DescribeSpec(
class SSLValidatorTest : StringSpec(
{
val validator = SSLValidator()

describe("SSLValidator") {
it("validate should return the right result").config(timeout = 30.seconds) {
table(
headers("url", "isValid"),
row("https://sha256.badssl.com/", true),
row("https://sha384.badssl.com/", true),
row("https://sha512.badssl.com/", true),
row("https://1000-sans.badssl.com/", true),
row("https://10000-sans.badssl.com/", true),
row("https://ecc256.badssl.com/", true),
row("https://ecc384.badssl.com/", true),
row("https://rsa2048.badssl.com/", true),
row("https://rsa4096.badssl.com/", true),
row("https://rsa8192.badssl.com/", true),
row("https://extended-validation.badssl.com/", true),
"validate should return the right result" {
table(
headers("url", "isValid"),
row("https://sha256.badssl.com/", true),
row("https://sha384.badssl.com/", true),
row("https://sha512.badssl.com/", true),
row("https://1000-sans.badssl.com/", true),
row("https://10000-sans.badssl.com/", true),
row("https://ecc256.badssl.com/", true),
row("https://ecc384.badssl.com/", true),
row("https://rsa2048.badssl.com/", true),
row("https://rsa4096.badssl.com/", true),
row("https://rsa8192.badssl.com/", true),
row("https://extended-validation.badssl.com/", true),

row("https://expired.badssl.com/", false),
row("https://wrong.host.badssl.com/", false),
row("https://self-signed.badssl.com/", false),
row("https://untrusted-root.badssl.com/", false),
row("https://no-common-name.badssl.com/", false),
row("https://no-subject.badssl.com/", false),
row("https://incomplete-chain.badssl.com/", false)
).forAll { url, isValid ->
val result = validator.validate(URL(url))
row("https://expired.badssl.com/", false),
row("https://wrong.host.badssl.com/", false),
row("https://self-signed.badssl.com/", false),
row("https://untrusted-root.badssl.com/", false),
row("https://no-common-name.badssl.com/", false),
row("https://no-subject.badssl.com/", false),
row("https://incomplete-chain.badssl.com/", false)
).forAll { url, isValid ->
val result = validator.validate(URL(url))
println(url)
println(isValid)
println(result)

(if (isValid) result.isRight() else result.isLeft()).shouldBeTrue()
}
(if (isValid) result.isRight() else result.isLeft()).shouldBeTrue()
}
}
}
Expand Down

0 comments on commit 5ea7762

Please sign in to comment.