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

Uses TF_BUILD in vendors.json #116

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ test('AppVeyor - Not PR', function (t) {
})

test('Azure Pipelines - PR', function (t) {
process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = 'https://dev.azure.com/Contoso'
process.env.SYSTEM_PULLREQUEST_PULLREQUESTID = '42'
process.env.TF_BUILD = 'true'
process.env.BUILD_REASON = 'PullRequest'

clearModule('./')
const ci = require('./')
Expand All @@ -136,14 +136,14 @@ test('Azure Pipelines - PR', function (t) {
t.equal(ci.AZURE_PIPELINES, true)
assertVendorConstants('AZURE_PIPELINES', ci, t)

delete process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
delete process.env.SYSTEM_PULLREQUEST_PULLREQUESTID
delete process.env.TF_BUILD
delete process.env.BUILD_REASON

t.end()
})

test('Azure Pipelines - Not PR', function (t) {
process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = 'https://dev.azure.com/Contoso'
process.env.TF_BUILD = 'true'

clearModule('./')
const ci = require('./')
Expand All @@ -154,7 +154,7 @@ test('Azure Pipelines - Not PR', function (t) {
t.equal(ci.AZURE_PIPELINES, true)
assertVendorConstants('AZURE_PIPELINES', ci, t)

delete process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
delete process.env.TF_BUILD

t.end()
})
Expand Down
6 changes: 4 additions & 2 deletions vendors.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
{
"name": "Azure Pipelines",
"constant": "AZURE_PIPELINES",
"env": "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",
"pr": "SYSTEM_PULLREQUEST_PULLREQUESTID"
"env": "TF_BUILD",
"pr": {
"BUILD_REASON": "PullRequest"
}
},
{
"name": "Bamboo",
Expand Down