Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Add end-to-end continuous integration tests for Homebrew distribution #243

Merged
merged 4 commits into from
Apr 24, 2021

Conversation

Lukas-Stuehrk
Copy link
Member

@Lukas-Stuehrk Lukas-Stuehrk commented Apr 4, 2021

This changes the end-to-end tests so it's possible to use the tests with the swift-doc version installed via homebrew.

It also adds a new GitHub actions workflow to run the end-to-tests with the homebrew version of swift-doc, both from bottle and from source.

This implements #202.

Unfortunately, the integration tests will fail. I can reproduce this also on my machine when I use the swift-doc version from homebrew:

lukas@grumpycat ~/src/swift-doc $ which swift-doc                                                                           
/Users/lukas/homebrew/bin/swift-doc
lukas@grumpycat ~/src/swift-doc $ swift-doc generate --module-name SwiftDoc --format commonmark --output /tmp/docs .
[1]    47753 illegal hardware instruction  swift-doc generate --module-name SwiftDoc --format commonmark --output  .

The crashing line is

assert(node.parent?.parent?.is(IfConfigDeclSyntax.self) == true)

@mattt mattt added this to the 1.0.0-beta.6 milestone Apr 17, 2021
@mattt
Copy link
Contributor

mattt commented Apr 17, 2021

Unfortunately, the integration tests will fail. I can reproduce this also on my machine when I use the swift-doc version from homebrew:

lukas@grumpycat ~/src/swift-doc $ which swift-doc                                                                           
/Users/lukas/homebrew/bin/swift-doc
lukas@grumpycat ~/src/swift-doc $ swift-doc generate --module-name SwiftDoc --format commonmark --output /tmp/docs .
[1]    47753 illegal hardware instruction  swift-doc generate --module-name SwiftDoc --format commonmark --output  .

The crashing line is

assert(node.parent?.parent?.is(IfConfigDeclSyntax.self) == true)

Huh, that's surprising. I thought Homebrew built and installed in release mode, so assertions would be disabled. Let me double-check what we're doing in our formula. At the very least, I can remove that assertion — that's something we could and probably should be validating in a unit test instead.

@mattt
Copy link
Contributor

mattt commented Apr 17, 2021

Unfortunately, the integration tests will fail. I can reproduce this also on my machine when I use the swift-doc version from homebrew...

Oh wait, I recognize that crash! That's what happens when you try to run swift-doc on SwiftSyntax (or one of the other dependencies). Fortunately, this is fixed by #229. We can hold off on merging this until that gets into an official release.

Pass swiftDocCommand directly to Process.run
@mattt mattt merged commit 4c2f16f into SwiftDocOrg:master Apr 24, 2021
@Lukas-Stuehrk Lukas-Stuehrk deleted the homebrew-e2e-tests branch April 24, 2021 11:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants