Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web5 test vectors setup & integration #5

Merged
merged 8 commits into from
Feb 1, 2024
Merged

Conversation

amika-sq
Copy link
Contributor

@amika-sq amika-sq commented Jan 31, 2024

Removes the copied test vectors, and instead pulls them in from the web5-spec repository, which is added to this repo as a submodule.

Also added the necessary Github actions to upload artifacts and trigger a SDK report runner build.

@nitro-neal
Copy link
Collaborator

looks good so far!

@amika-sq amika-sq marked this pull request as ready for review January 31, 2024 21:56
@nitro-neal
Copy link
Collaborator

import XCTest

@testable import Web5

final class Web5TestVectorsDidJwk: XCTestCase {

    func test_resolve() throws {
        let testVector = try TestVector<String, DIDResolutionResult>(
            fileName: "resolve",
            subdirectory: "test-vectors/did_jwk"
        )

        testVector.run { vector in
            let expectation = XCTestExpectation(description: "async resolve")
            Task {
                let didURI = vector.input
                let result = await DIDJWK.resolve(didURI: didURI)
                XCTAssertNoDifference(result, vector.output)
                expectation.fulfill()
            }

            wait(for: [expectation], timeout: 1)
        }
    }

}

so I see the test name is test_resolve.

For it to just 'work out of the box' and be the same as everything else the test name should be resolve

If this is not possible or a massive anti pattern it is ok to keep it and we can change the runner to accept this

@amika-sq
Copy link
Contributor Author

amika-sq commented Feb 1, 2024

import XCTest

@testable import Web5

final class Web5TestVectorsDidJwk: XCTestCase {

    func test_resolve() throws {
        let testVector = try TestVector<String, DIDResolutionResult>(
            fileName: "resolve",
            subdirectory: "test-vectors/did_jwk"
        )

        testVector.run { vector in
            let expectation = XCTestExpectation(description: "async resolve")
            Task {
                let didURI = vector.input
                let result = await DIDJWK.resolve(didURI: didURI)
                XCTAssertNoDifference(result, vector.output)
                expectation.fulfill()
            }

            wait(for: [expectation], timeout: 1)
        }
    }

}

so I see the test name is test_resolve.

For it to just 'work out of the box' and be the same as everything else the test name should be resolve

If this is not possible or a massive anti pattern it is ok to keep it and we can change the runner to accept this

Unfortunately, this won't be possible. In order for a function to be considered a test case, it must have the test prefix.

@amika-sq amika-sq merged commit 83a00c2 into main Feb 1, 2024
1 check passed
@amika-sq amika-sq deleted the test-vector-junit branch February 1, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants