How to run Integration just when merging to master
I've Travis CI which is working as expected for Go application
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
This CI takes about a 60-80 sec
to run.
The CI is triggered in two scenarios
- Submitting to new branch
- Merging to the master
Now I've new file which is called integration_test.go
which is running integration test which takes about 10 min (deployment etc)
and I want to run this test only when merging to the master (since its more heavy) , and not run when submitting to branches, how it can be done it Travis?
I've tried with
on:
branch: master
condition: `go test -v integration_test.go`
git go github travis-ci travis-ci-cli
|
show 2 more comments
I've Travis CI which is working as expected for Go application
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
This CI takes about a 60-80 sec
to run.
The CI is triggered in two scenarios
- Submitting to new branch
- Merging to the master
Now I've new file which is called integration_test.go
which is running integration test which takes about 10 min (deployment etc)
and I want to run this test only when merging to the master (since its more heavy) , and not run when submitting to branches, how it can be done it Travis?
I've tried with
on:
branch: master
condition: `go test -v integration_test.go`
git go github travis-ci travis-ci-cli
Have you tried reading the Travis docs on conditional functionality?
– jonrsharpe
Nov 17 '18 at 19:17
@jonrsharpe - yep I try it without success, see my edit please, do you know what am I missing here ?
– user6124024
Nov 17 '18 at 19:22
That's just not how conditional stages work; see docs.travis-ci.com/user/conditional-builds-stages-jobs
– jonrsharpe
Nov 17 '18 at 19:27
@jonrsharpe - Ok thanks but How should I tell it run only this testif: branch = master
go test -v integration_test.go`` ?
– user6124024
Nov 17 '18 at 19:29
@jonrsharpe - can you provide a reference for my issue please?
– user6124024
Nov 17 '18 at 19:30
|
show 2 more comments
I've Travis CI which is working as expected for Go application
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
This CI takes about a 60-80 sec
to run.
The CI is triggered in two scenarios
- Submitting to new branch
- Merging to the master
Now I've new file which is called integration_test.go
which is running integration test which takes about 10 min (deployment etc)
and I want to run this test only when merging to the master (since its more heavy) , and not run when submitting to branches, how it can be done it Travis?
I've tried with
on:
branch: master
condition: `go test -v integration_test.go`
git go github travis-ci travis-ci-cli
I've Travis CI which is working as expected for Go application
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
This CI takes about a 60-80 sec
to run.
The CI is triggered in two scenarios
- Submitting to new branch
- Merging to the master
Now I've new file which is called integration_test.go
which is running integration test which takes about 10 min (deployment etc)
and I want to run this test only when merging to the master (since its more heavy) , and not run when submitting to branches, how it can be done it Travis?
I've tried with
on:
branch: master
condition: `go test -v integration_test.go`
git go github travis-ci travis-ci-cli
git go github travis-ci travis-ci-cli
edited Nov 18 '18 at 8:51
Flimzy
38.2k96597
38.2k96597
asked Nov 17 '18 at 19:16
user6124024
Have you tried reading the Travis docs on conditional functionality?
– jonrsharpe
Nov 17 '18 at 19:17
@jonrsharpe - yep I try it without success, see my edit please, do you know what am I missing here ?
– user6124024
Nov 17 '18 at 19:22
That's just not how conditional stages work; see docs.travis-ci.com/user/conditional-builds-stages-jobs
– jonrsharpe
Nov 17 '18 at 19:27
@jonrsharpe - Ok thanks but How should I tell it run only this testif: branch = master
go test -v integration_test.go`` ?
– user6124024
Nov 17 '18 at 19:29
@jonrsharpe - can you provide a reference for my issue please?
– user6124024
Nov 17 '18 at 19:30
|
show 2 more comments
Have you tried reading the Travis docs on conditional functionality?
– jonrsharpe
Nov 17 '18 at 19:17
@jonrsharpe - yep I try it without success, see my edit please, do you know what am I missing here ?
– user6124024
Nov 17 '18 at 19:22
That's just not how conditional stages work; see docs.travis-ci.com/user/conditional-builds-stages-jobs
– jonrsharpe
Nov 17 '18 at 19:27
@jonrsharpe - Ok thanks but How should I tell it run only this testif: branch = master
go test -v integration_test.go`` ?
– user6124024
Nov 17 '18 at 19:29
@jonrsharpe - can you provide a reference for my issue please?
– user6124024
Nov 17 '18 at 19:30
Have you tried reading the Travis docs on conditional functionality?
– jonrsharpe
Nov 17 '18 at 19:17
Have you tried reading the Travis docs on conditional functionality?
– jonrsharpe
Nov 17 '18 at 19:17
@jonrsharpe - yep I try it without success, see my edit please, do you know what am I missing here ?
– user6124024
Nov 17 '18 at 19:22
@jonrsharpe - yep I try it without success, see my edit please, do you know what am I missing here ?
– user6124024
Nov 17 '18 at 19:22
That's just not how conditional stages work; see docs.travis-ci.com/user/conditional-builds-stages-jobs
– jonrsharpe
Nov 17 '18 at 19:27
That's just not how conditional stages work; see docs.travis-ci.com/user/conditional-builds-stages-jobs
– jonrsharpe
Nov 17 '18 at 19:27
@jonrsharpe - Ok thanks but How should I tell it run only this test
if: branch = master
go test -v integration_test.go`` ?– user6124024
Nov 17 '18 at 19:29
@jonrsharpe - Ok thanks but How should I tell it run only this test
if: branch = master
go test -v integration_test.go`` ?– user6124024
Nov 17 '18 at 19:29
@jonrsharpe - can you provide a reference for my issue please?
– user6124024
Nov 17 '18 at 19:30
@jonrsharpe - can you provide a reference for my issue please?
– user6124024
Nov 17 '18 at 19:30
|
show 2 more comments
1 Answer
1
active
oldest
votes
What you're likely looking for here is a 'Conditional job'. Using the example here:
https://docs.travis-ci.com/user/build-stages/matrix-expansion/
try:
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
jobs:
include:
- stage: integration
if: branch = master
script: go test -v integration_test.go
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53354651%2fhow-to-run-integration-just-when-merging-to-master%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you're likely looking for here is a 'Conditional job'. Using the example here:
https://docs.travis-ci.com/user/build-stages/matrix-expansion/
try:
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
jobs:
include:
- stage: integration
if: branch = master
script: go test -v integration_test.go
add a comment |
What you're likely looking for here is a 'Conditional job'. Using the example here:
https://docs.travis-ci.com/user/build-stages/matrix-expansion/
try:
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
jobs:
include:
- stage: integration
if: branch = master
script: go test -v integration_test.go
add a comment |
What you're likely looking for here is a 'Conditional job'. Using the example here:
https://docs.travis-ci.com/user/build-stages/matrix-expansion/
try:
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
jobs:
include:
- stage: integration
if: branch = master
script: go test -v integration_test.go
What you're likely looking for here is a 'Conditional job'. Using the example here:
https://docs.travis-ci.com/user/build-stages/matrix-expansion/
try:
language: go
go:
- "1.10.x"
script:
- go get -v -t -d ./...
- go test -v ./...
jobs:
include:
- stage: integration
if: branch = master
script: go test -v integration_test.go
answered Nov 17 '18 at 19:41
nbpnbp
383
383
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53354651%2fhow-to-run-integration-just-when-merging-to-master%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried reading the Travis docs on conditional functionality?
– jonrsharpe
Nov 17 '18 at 19:17
@jonrsharpe - yep I try it without success, see my edit please, do you know what am I missing here ?
– user6124024
Nov 17 '18 at 19:22
That's just not how conditional stages work; see docs.travis-ci.com/user/conditional-builds-stages-jobs
– jonrsharpe
Nov 17 '18 at 19:27
@jonrsharpe - Ok thanks but How should I tell it run only this test
if: branch = master
go test -v integration_test.go`` ?– user6124024
Nov 17 '18 at 19:29
@jonrsharpe - can you provide a reference for my issue please?
– user6124024
Nov 17 '18 at 19:30