From 6f72cd5084238868d6c5023c203d0df436527dce Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Fri, 23 Aug 2024 16:46:47 -0400 Subject: [PATCH] Add specs-report on CI (#101) * Add specs-report on CI * rename tbdex swift tests --- .github/workflows/ci.yml | 15 +++++++++++++++ .../tbDEXTestVectorsProtocol.swift | 16 ++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7f982e..91fe7bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,22 @@ jobs: run: swift build - name: Run tests + id: tests run: swift test --enable-code-coverage + + - name: Execute Spec Test Vector Report + if: always() && steps.tests.conclusion != 'skipped' + uses: TBD54566975/sdk-report-runner/.github/actions/specs-report@main + with: + junit-report-paths: tests.xml + spec-path: Tests/tbDEXTestVectors/tbdex-spec + suite-name-regex: tbDEXTestVectors + feature-regex: tbDEXTestVectors(\w+) + vector-regex: test_(\w+) + fail-on-missing-vectors: false + fail-on-failed-test-cases: true + comment-on-pr: true + git-token: ${{ secrets.GITHUB_TOKEN }} - name: Convert the coverage data run: llvm-cov export -format="lcov" .build/*-apple-macosx/debug/TbdexPackageTests.xctest/Contents/MacOS/TbdexPackageTests -instr-profile .build/*-apple-macosx/debug/codecov/default.profdata > info.lcov diff --git a/Tests/tbDEXTestVectors/tbDEXTestVectorsProtocol.swift b/Tests/tbDEXTestVectors/tbDEXTestVectorsProtocol.swift index 8815c3e..74a67c4 100644 --- a/Tests/tbDEXTestVectors/tbDEXTestVectorsProtocol.swift +++ b/Tests/tbDEXTestVectors/tbDEXTestVectorsProtocol.swift @@ -9,7 +9,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { // MARK: - Resources - func test_parseOffering() throws { + func test_parse_offering() throws { let vector = try TestVector( fileName: "parse-offering", subdirectory: vectorSubdirectory @@ -23,7 +23,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { XCTAssertNoDifference(parsedOffering, vector.output) } - func test_parseBalance() throws { + func test_parse_balance() throws { let vector = try TestVector( fileName: "parse-balance", subdirectory: vectorSubdirectory @@ -39,7 +39,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { // MARK: - Messages - func test_parseClose() throws { + func test_parse_close() throws { let vector = try TestVector( fileName: "parse-close", subdirectory: vectorSubdirectory @@ -53,7 +53,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { XCTAssertNoDifference(parsedClose, vector.output) } - func test_parseOrder() throws { + func test_parse_order() throws { let vector = try TestVector( fileName: "parse-order", subdirectory: vectorSubdirectory @@ -67,7 +67,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { XCTAssertNoDifference(parsedOrder, vector.output) } - func test_parseOrderStatus() throws { + func test_parse_orderstatus() throws { let vector = try TestVector( fileName: "parse-orderstatus", subdirectory: vectorSubdirectory @@ -81,7 +81,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { XCTAssertNoDifference(parsedOrderStatus, vector.output) } - func test_parseQuote() throws { + func test_parse_quote() throws { let vector = try TestVector( fileName: "parse-quote", subdirectory: vectorSubdirectory @@ -95,7 +95,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { XCTAssertNoDifference(parsedQuote, vector.output) } - func test_parseRfq() throws { + func test_parse_rfq() throws { let vector = try TestVector( fileName: "parse-rfq", subdirectory: vectorSubdirectory @@ -109,7 +109,7 @@ final class tbDEXTestVectorsProtocol: XCTestCase { XCTAssertNoDifference(parsedRFQ, vector.output) } - func test_parseRfqOmitPrivateData() throws { + func test_parse_rfq_omit_private_data() throws { let vector = try TestVector( fileName: "parse-rfq-omit-private-data", subdirectory: vectorSubdirectory