Skip to content

Commit

Permalink
Remove PROJECT_ROOT Make var (#9953)
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Jun 24, 2022
1 parent c2470f0 commit b06b860
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PROJECT_NAME := Pulumi SDK
PROJECT_ROOT := ..
SDKS := dotnet nodejs python go
SUB_PROJECTS := $(SDKS:%=sdk/%)

Expand All @@ -23,6 +22,9 @@ TESTPARALLELISM ?= 10
# `test_all` without the dependencies.
TEST_ALL_DEPS ?= build $(SUB_PROJECTS:%=%_install)

GO_TEST = $(PYTHON) ../scripts/go-test.py $(GO_TEST_FLAGS)
GO_TEST_FAST = $(PYTHON) ../scripts/go-test.py $(GO_TEST_FAST_FLAGS)

ensure: .ensure.phony pulumictl.ensure go.ensure $(SUB_PROJECTS:%=%_ensure)
.ensure.phony: sdk/go.mod pkg/go.mod tests/go.mod
cd sdk && go mod download
Expand Down
10 changes: 7 additions & 3 deletions build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ PIP ?= pip3
PULUMI_BIN := $(PULUMI_ROOT)/bin
PULUMI_NODE_MODULES := $(PULUMI_ROOT)/node_modules
PULUMI_NUGET := $(PULUMI_ROOT)/nuget
GO_TEST_OPTIONS :=

GO_TEST_FAST = $(PYTHON) ${PROJECT_ROOT}/scripts/go-test.py -short -count=1 -cover -tags=all -timeout 1h -parallel ${TESTPARALLELISM} ${GO_TEST_OPTIONS}
GO_TEST = $(PYTHON) $(PROJECT_ROOT)/scripts/go-test.py -count=1 -cover -timeout 1h -tags=all -parallel ${TESTPARALLELISM} ${GO_TEST_OPTIONS}
# Extra options to pass to `go test` command, for example:
#
# make GO_TEST_OPTIONS="-short -test.v" test_fast
GO_TEST_OPTIONS :=

GO_TEST_FLAGS = -count=1 -cover -tags=all -timeout 1h -parallel ${TESTPARALLELISM} ${GO_TEST_OPTIONS}
GO_TEST_FAST_FLAGS = -short ${GO_TEST_FLAGS}
GOPROXY = 'https://proxy.golang.org'

.PHONY: default all only_build only_test lint install test_all core build
Expand Down
4 changes: 3 additions & 1 deletion sdk/dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PROJECT_NAME := Pulumi .NET Core SDK
LANGHOST_PKG := github.com/pulumi/pulumi/sdk/v3/dotnet/cmd/pulumi-language-dotnet

PROJECT_PKGS := $(shell go list ./cmd...)
PROJECT_ROOT := ../..

DOTNET_VERSION := $(if ${PULUMI_VERSION},${PULUMI_VERSION},$(shell cd ../../ && pulumictl get version --language dotnet))

Expand All @@ -26,6 +25,9 @@ else
TEST_COVERAGE_ARGS := -p:CollectCoverage=false -p:CoverletOutput=$(PULUMI_TEST_COVERAGE_PATH)
endif

GO_TEST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FLAGS)
GO_TEST_FAST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FAST_FLAGS)

build::
# From the nuget docs:
#
Expand Down
4 changes: 3 additions & 1 deletion sdk/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ VERSION := $(if ${PULUMI_VERSION},${PULUMI_VERSION},$(shell cd ../../ &
TEST_FAST_PKGS := $(shell go list ./pulumi/... ./pulumi-language-go/... ./common/... | grep -v /vendor/ | grep -v templates)
TEST_AUTO_PKGS := $(shell go list ./auto/... | grep -v /vendor/ | grep -v templates)
TESTPARALLELISM ?= 10
PROJECT_ROOT := ../..

include ../../build/common.mk

# Motivation: running `make TEST_ALL_DEPS= test_all` permits running
# `test_all` without the dependencies.
TEST_ALL_DEPS ?= install

GO_TEST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FLAGS)
GO_TEST_FAST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FAST_FLAGS)

gen::
go generate ./pulumi/...

Expand Down
4 changes: 3 additions & 1 deletion sdk/nodejs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ NODE_MODULE_NAME := @pulumi/pulumi
VERSION := $(if ${PULUMI_VERSION},${PULUMI_VERSION},$(shell cd ../../ && pulumictl get version --language javascript))

LANGUAGE_HOST := github.com/pulumi/pulumi/sdk/v3/nodejs/cmd/pulumi-language-nodejs
PROJECT_ROOT := ../..

PROJECT_PKGS := $(shell go list ./cmd...)
TESTPARALLELISM ?= 10
Expand All @@ -17,6 +16,9 @@ include ../../build/common.mk

export PATH:=$(shell yarn bin 2>/dev/null):$(PATH)

GO_TEST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FLAGS)
GO_TEST_FAST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FAST_FLAGS)

ensure:: yarn.ensure node.ensure .ensure.phony
.ensure.phony: package.json
yarn install
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PROJECT_NAME := Pulumi Python SDK
LANGHOST_PKG := github.com/pulumi/pulumi/sdk/v3/python/cmd/pulumi-language-python
VERSION := $(if ${PULUMI_VERSION},${PULUMI_VERSION},$(shell cd ../../ && pulumictl get version))
PYPI_VERSION := $(if ${PULUMI_VERSION},${PULUMI_VERSION},$(shell cd ../../ && pulumictl get version --language python))
PROJECT_ROOT := ../..

PYENV := ./env
PYENVSRC := $(PYENV)/src
Expand All @@ -18,6 +17,9 @@ include ../../build/common.mk
# `test_all` without the dependencies.
TEST_ALL_DEPS ?= build

GO_TEST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FLAGS)
GO_TEST_FAST = $(PYTHON) ../../scripts/go-test.py $(GO_TEST_FAST_FLAGS)

ensure:: $(PYTHON).ensure .ensure.phony
.ensure.phony:
$(PYTHON) -m venv venv
Expand Down

0 comments on commit b06b860

Please sign in to comment.