This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
61 lines (50 loc) · 2.66 KB
/
Makefile
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
CB_TARGET_BRANCH ?= $(strip $(shell git remote show origin | grep "HEAD branch" | cut -d ":" -f 2))
CB_VERSION ?= $(shell ./scripts/get-latest-version.sh)
GIT_ACTIVE_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
BLUEPRINT_URL ?= https://raw.githubusercontent.com/hortonworks/cb-cli/$(GIT_ACTIVE_BRANCH)/tests/blueprints/test.bp
all: start-mock integration-test stop-mock clean-after-tests
clean: stop-mock clean-after-tests
# After 'make deps' you should 'source /Users/$USER/.rvm/scripts/rvm'
deps:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby
gem install rspec
gem install aruba
gem install aruba-rspec
gem install json
gem install rspec-json_expectations
gem install rspec_junit_formatter
gem install allure-rspec
# Start a new Mock with new Swagger JSON
# For custom version apply as: 'GIT_FIRST_PARENT=2.8.0-dev.374 make start-mock'
start-mock:
CLEANUP=true scripts/mock-test-helper.sh
CB_TARGET_BRANCH=$(CB_TARGET_BRANCH) CB_VERSION=$(CB_VERSION) tmp/cbm.sh
# Stop DataPlane Mock
stop-mock:
STOP_MOCK=true tmp/cbm.sh
# Restart DataPlane Mock (only Containers are restarted) with same Swagger JSON
restart-mock: stop-mock
CB_VERSION=$(CB_VERSION) tmp/cbm.sh
# For custom version apply as: 'GIT_FIRST_PARENT=2.8.0-dev.374 make download-s3'
download-s3:
curl -k https://s3-eu-central-1.amazonaws.com/cloudbreak-swagger/swagger-$(CB_VERSION).json -o swagger-cloudbreak.json
curl -k https://s3-us-east-2.amazonaws.com/environment-swagger/swagger-$(CB_VERSION).json -o swagger-environment.json
curl -k https://s3-us-east-2.amazonaws.com/freeipa-swagger/swagger-$(CB_VERSION).json -o swagger-freeipa.json
curl -k https://s3-us-east-2.amazonaws.com/redbeams-swagger/swagger-$(CB_VERSION).json -o swagger-redbeams.json
curl -k https://s3-us-east-2.amazonaws.com/datalake-swagger/swagger-$(CB_VERSION).json -o swagger-datalake.json
curl -k https://s3-us-east-2.amazonaws.com/autoscale-swagger/swagger-$(CB_VERSION).json -o swagger-autoscale.json
# You can re-run a test case or an entire test suite with no Docker Pull
rerun-integration-test:
BLUEPRINT_URL=$(BLUEPRINT_URL) IMAGE_UPDATE=false tmp/docker-test.sh
# Start a new DataPlane Mock with new Swagger JSON
# For custom version apply like: 'GIT_FIRST_PARENT=2.8.0-dev.374 make start-mock'
# Execute an entire test suite or just one scenario you can start this with: 'CLI_TEST_FILES=spec/integration/credential.rb make integration-test'
integration-test:
rm -rf allure/ test-results/
BLUEPRINT_URL=$(BLUEPRINT_URL) tmp/docker-test.sh
clean-after-tests:
sudo chmod -Rf 777 tmp/
rm -rf test-logs/ tmp/ .dp swagger-*.json
.PHONY:
all