generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (69 loc) · 2.48 KB
/
Makefile
File metadata and controls
83 lines (69 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.PHONY: target
target:
$(info ${HELP_MESSAGE})
@exit 0
.PHONY: init
init:
bundle install
.PHONY: setup-codebuild-agent
setup-codebuild-agent:
docker build -t codebuild-agent - < test/integration/codebuild-local/Dockerfile.agent
.PHONY: test-smoke
test-smoke: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent test/integration/codebuild-local/test_one.sh test/integration/codebuild/buildspec.os.alpine.1.yml alpine 3.16 3.1
.PHONY: test-unit
test-unit:
ruby test/run_tests.rb unit
.PHONY: test-integ
test-integ: setup-codebuild-agent
CODEBUILD_IMAGE_TAG=codebuild-agent test/integration/codebuild-local/test_all.sh test/integration/codebuild
.PHONY: build
build:
rake build
.PHONY: run-local-ric
run-local-ric:
scripts/run-local-ric.sh
.PHONY: test-dockerized
test-dockerized:
@echo "Running dockerized tests locally..."
@if [ -z "$(RUBY_VERSION)" ]; then \
echo "Error: RUBY_VERSION is not set. Usage: make test-dockerized RUBY_VERSION=3.3"; \
exit 1; \
fi
@echo "Building the lib..."
$(MAKE) build
@echo "Building Docker image for Ruby $(RUBY_VERSION)..."
docker build . -t local/test -f Dockerfile.test --build-arg BASE_IMAGE=public.ecr.aws/lambda/ruby:$(RUBY_VERSION)
@echo "Setting up containerized test runner..."
@if [ ! -d ".test-runner" ]; then \
echo "Copying local containerized-test-runner-for-aws-lambda..."; \
cp -r ../containerized-test-runner-for-aws-lambda .test-runner; \
fi
@echo "Building test runner Docker image..."
@docker build -t test-runner:local -f .test-runner/Dockerfile .test-runner
@echo "Running tests in Docker..."
@docker run --rm \
--entrypoint suite \
-e DOCKER_API_VERSION=1.41 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(CURDIR)/test/dockerized/tasks:$(CURDIR)/test/dockerized/tasks:ro \
-v $(CURDIR)/test/dockerized/suites:/suites:ro \
test-runner:local \
--test-image local/test \
--debug \
/suites/*.json
.PHONY: pr
pr: init test-unit test-smoke
define HELP_MESSAGE
Usage: $ make [TARGETS]
TARGETS
build Builds the package.
clean Cleans the working directory by removing built artifacts.
init Initialize and install the dependencies and dev-dependencies for this project.
test-integ Run Integration tests.
test-unit Run Unit Tests.
test-smoke Run Sanity/Smoke tests.
test-dockerized Run dockerized tests locally (requires RUBY_VERSION=X.X).
run-local-ric Run local RIC changes with Runtime Interface Emulator.
pr Perform all checks before submitting a Pull Request.
endef