Skip to content

Commit c8f4510

Browse files
committed
Modified Makefile and test in order to possibly test a different next version
Signed-off-by: Lou Marvin Caraig <[email protected]>
1 parent 900c924 commit c8f4510

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Makefile

+14-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ GOTEST_INTEGRATION = $(GOTEST) -parallel 1 -count 1 -tags=integration -ldflags "
1919

2020
OS := $(shell uname)
2121
PREV_BUILD_PATH := build-prev
22+
NEXT_BUILD_PATH := build-next
2223

2324
CURRENT_VERSION := $(shell git rev-parse --abbrev-ref HEAD)
25+
26+
# Latest non release candidate version
2427
PREV_VERSION ?= $(shell git describe --abbrev=0 --tags --exclude "*-rc*")
28+
# Current commit
29+
NEXT_VERSION ?= $(CURRENT_VERSION)
2530

2631
# Targets for integration testing
2732
integration-clean-previous:
@@ -34,9 +39,15 @@ integration-build-previous: integration-clean-previous integration-prepare-build
3439
git checkout -q $(CURRENT_VERSION)
3540
echo "Built version $(PREV_VERSION)"
3641

37-
integration-clean-current: clean
38-
integration-build-current: integration-clean-current build docker-build
39-
echo "Built current version"
42+
integration-clean-current:
43+
rm -rf $(NEXT_BUILD_PATH)
44+
$(GOCLEAN) .
45+
integration-prepare-build-current:
46+
git checkout -q $(NEXT_VERSION)
47+
$(eval BUILD_PATH = $(NEXT_BUILD_PATH))
48+
integration-build-current: integration-clean-current integration-prepare-build-current build docker-build
49+
git checkout -q $(CURRENT_VERSION)
50+
echo "Built version $(NEXT_VERSION)"
4051

4152
integration-build-all:
4253
$(MAKE) integration-build-current

cmd/test-utils/common.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
// TODO (carlosms) this could be build/bin, workaround for https://github.com/src-d/ci/issues/97
1818
var srcdBin = fmt.Sprintf("../../../build/engine_%s_%s/srcd", runtime.GOOS, runtime.GOARCH)
1919
var srcdPrevBin = fmt.Sprintf("../../../build-prev/engine_%s_%s/srcd", runtime.GOOS, runtime.GOARCH)
20+
var srcdNextBin = fmt.Sprintf("../../../build-next/engine_%s_%s/srcd", runtime.GOOS, runtime.GOARCH)
2021
var configFile = "../../../integration-testing-config.yaml"
2122

2223
func init() {
@@ -64,7 +65,7 @@ type IntegrationBackCompSuite struct {
6465

6566
func NewIntegrationBackCompSuite() IntegrationBackCompSuite {
6667
return IntegrationBackCompSuite{
67-
IntegrationSuite: NewIntegrationSuite(),
68+
IntegrationSuite: IntegrationSuite{Cmd: &Commander{bin: srcdNextBin}},
6869
PrevCmd: &Commander{bin: srcdPrevBin},
6970
}
7071
}

0 commit comments

Comments
 (0)