Closed cvarjao closed 3 years ago
GitHub Actions from outside forks are still failing. Issue reopened.
npm run test
passes, but excludes all *.test.ts. Including those we have the following.
Failing on detached head only:
Failing on branch and detached head:
Passing:
for i in `find test/ -type f -iname *.js -o -iname *.ts ! -name build.* ! -name on-jira-event.* ! -name jira-rfd.* ! -name rfd-helper.*`; do npm run mocha -- $i; done
build.test.js testing command:
nrdk build --config-script test/commands/build.config.js --build-script test/commands/build.build.js
Detached head:
Starting @bcgov/nrdk/0.1.0-rc.91 linux-x64 node-v14.15.4
info: Applying default value for git.url {"category":"OnJiraIssue","timestamp":"2021-02-23T20:27:07.135Z"}
info: Applying default value for git.remote.url {"category":"OnJiraIssue","timestamp":"2021-02-23T20:27:07.192Z"}
info: Applying default value for git.branch.name {"category":"OnJiraIssue","timestamp":"2021-02-23T20:27:07.193Z"}
info: Applying default value for git.branch.merge {"category":"OnJiraIssue","timestamp":"2021-02-23T20:27:07.195Z"}
info: Applying default value for git.change.target {"category":"OnJiraIssue","timestamp":"2021-02-23T20:27:07.196Z"}
Branch:
Starting @bcgov/nrdk/0.1.0-rc.91 linux-x64 node-v14.15.4
info: Applying default value for git.url {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.289Z"}
info: Applying default value for git.remote.url {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.339Z"}
info: Applying default value for git.branch.name {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.341Z"}
info: Applying default value for git.branch.merge {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.343Z"}
info: Applying default value for git.change.target {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.344Z"}
info: Applying default value for build-script {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.351Z"}
info: Applying default value for deploy-script {"category":"OnJiraIssue","timestamp":"2021-02-23T20:30:30.352Z"}
--config-script=test/commands/build.config.js --build-script=test/commands/build.build.js --git.remote.name=origin --dev-mode=false --rfc-validation=true --git.url=git@github.com:bcdevops/nrdk.git --git.remote.url=git@github.com:bcdevops/nrdk.git --git.branch.name=master --git.branch.merge=master --git.change.target=master --deploy-script=.pipeline/lib/deploy
Build started
Build finished
The missing output, triggering the failure, looks to be in test/commands/build.build.js:
const MyBuilder = class {
build() {
console.log('Build started')
console.log('Build finished')
}
}
module.exports = async settings => {
await new MyBuilder(settings).build()
}
By default pull request checkouts will checkout the
merge
ref (no thehead
ref) which means it creates a detached branch that may be conflicting with the test cases.Examples: From
push
event:from
pull_request
event: