This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test detect module. Test buildkite service detector. Edit snap service detector test to cover all paths.
- Loading branch information
Bjørn
authored and
Bjørn
committed
Dec 8, 2015
1 parent
2aeb508
commit dcf3a00
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
var detect = require("../lib/detect"); | ||
var execSync = require('child_process').execSync; | ||
if (!execSync) { | ||
var exec = require('execSync').exec; | ||
var execSync = function(cmd){ | ||
return exec(cmd).stdout; | ||
}; | ||
} | ||
|
||
describe("Codecov", function(){ | ||
|
||
it("can detect existing appveyor service", function(){ | ||
process.env.APPVEYOR = "true"; | ||
|
||
expect(detect().service).to.eql("appveyor"); | ||
}); | ||
|
||
it("can select local git service if no service is found", function(){ | ||
process.env.APPVEYOR = ""; | ||
|
||
expect(detect().commit).to.match(/^\w{40}$/); | ||
expect(detect().commit).to.eql(execSync("git rev-parse HEAD || hg id -i --debug | tr -d '+'").toString().trim()); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var buildkite = require("../../lib/services/buildkite"); | ||
|
||
describe("Buildkite CI Provider", function(){ | ||
|
||
it ("can detect buildkite", function(){ | ||
process.env.BUILDKITE = "true"; | ||
expect(buildkite.detect()).to.be(true); | ||
}); | ||
|
||
it ("can get buildkite env info", function(){ | ||
process.env.BUILDKITE_BUILD_NUMBER = "1"; | ||
process.env.BUILDKITE_BUILD_URL = "url"; | ||
process.env.BUILDKITE_COMMIT = "commit"; | ||
process.env.BUILDKITE_BRANCH = "branch"; | ||
process.env.BUILDKITE_PROJECT_SLUG = "slug"; | ||
|
||
expect(buildkite.configuration()).to.eql({ | ||
service : 'buildkite', | ||
build : "1", | ||
build_url : "url", | ||
commit : "commit", | ||
branch : "branch", | ||
slug : "slug" | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters