danger / danger/swift

Danger is crashing on travis says its not finding danger-response.

Open
#312 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.1k
Forks
152
Avg merge
9h 54m
Merged PRs (30d)
2

Description

I am trying to integrate danger 3.0 into our repo using package manger.

My package looks like so:

```
let package = Package(
name: "DangerTarget",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "DangerDeps",
type: .dynamic,
targets: ["DangerTarget"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/danger/swift.git", from: "3.0.0"),
.package(url: "https://github.com/f-meloni/danger-swift-xcodesummary", from: "1.1.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "DangerTarget",
dependencies: ["Danger", "DangerXCodeSummary"],
path: ".",
sources: ["dummy.swift"]),
]
)
```

I am using the installing and verifying using the steps described:

```
npm install -g danger
swift build
```

Danger file is:

```
let danger = Danger()
let xcodeSummary = XCodeSummary(filePath: "result.json")

let title = danger.github.pullRequest.title

if (title.contains("WIP")) {
danger.fail("This is a work in progress and can't be merged!")
}

if (!title.starts(with: "ORDER-")) {
danger.fail("Pull request should start with bug number!")
}

if let body = danger.github.pullRequest.body {
if (body.contains("https://keenwawa.atlassian.net/browse/???")) {
danger.fail("Forgot to link to Jira ticket!")
}

if (!body.contains("[x]")) {
danger.fail("Forgot to mark a type in the checklist!")
}
} else {
danger.fail("Missing pull request message")
}

xcodeSummary.report()

SwiftLint.lint(.all(directory: nil))
```

But when I run danger I am getting the following stack dump on travis.

```
Stack dump:
0. Program arguments: /Applications/Xcode-11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret /var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/_tmp_dangerfile.swift -enable-objc-interop -sdk /Applications/Xcode-11.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/travis/build/Keenwawa/Kiosk/.build/debug -module-name _tmp_dangerfile -lDanger -- /var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/danger-dsl.json /var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/danger-response.json
0 swift 0x0000000106c5aa63 PrintStackTraceSignalHandler(void*) + 51
1 swift 0x0000000106c5a236 SignalHandler(int) + 358
2 libsystem_platform.dylib 0x00007fff59563b5d _sigtramp + 29
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 2796143808
4 swift 0x00000001028cdcfd llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef) + 365
5 swift 0x00000001028d4cb2 llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, char const* const*) + 1090
6 swift 0x00000001028a7d5f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 45727
7 swift 0x00000001028992b4 swift::performFrontend(llvm::ArrayRef, char const*, void*, swift::FrontendObserver*) + 6820
8 swift 0x00000001028267b3 main + 1219
9 libdyld.dylib 0x00007fff5937e3d5 start + 1
10 libdyld.dylib 0x000000000000000f start + 2798132283
�[31mERROR: Dangerfile eval failed at Dangerfile.swift
�[0;0m�[31mERROR: Could not get the results JSON file at /var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/danger-response.json
�[0;0m

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.