Skip to content

Commit

Permalink
Change url assert in test_package
Browse files Browse the repository at this point in the history
  • Loading branch information
amysutedja committed Aug 28, 2020
1 parent 9e981b1 commit d1553e5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ VERSION := `git describe --tags --dirty 2>/dev/null`
COMMITHASH := `git rev-parse --short HEAD 2>/dev/null`
DATE := `date "+%FT%T%z"`

CONTAINER_NAME := 'splunk'

.PHONY: all
all: build_app test

Expand Down Expand Up @@ -56,3 +58,37 @@ splunkrc:
@echo "$(ATTN_COLOR)==> splunkrc $(NO_COLOR)"
@echo "To make a .splunkrc:"
@echo " [SPLUNK_INSTANCE_JSON] | python scripts/build-splunkrc.py ~/.splunkrc"

.PHONY: splunkrc_default
splunkrc_default:
@echo "$(ATTN_COLOR)==> splunkrc_default $(NO_COLOR)"
@python scripts/build-splunkrc.py ~/.splunkrc

.PHONY: up
up:
@echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
@docker-compose up -d

.PHONY: remove
remove:
@echo "$(ATTN_COLOR)==> rm $(NO_COLOR)"
@docker-compose rm -f -s

.PHONY: wait_up
wait_up:
@echo "$(ATTN_COLOR)==> wait_up $(NO_COLOR)"
@for i in `seq 0 180`; do if docker exec -it $(CONTAINER_NAME) /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done

.PHONY: down
down:
@echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
@docker-compose stop

.PHONY: start
start: up wait_up

.PHONY: restart
restart: down start

.PHONY: refresh
refresh: remove start
3 changes: 2 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def test_package(self):
p = self.app.package()
self.assertEqual(p.name, self.app_name)
self.assertTrue(p.path.endswith(self.app_name + '.spl'))
self.assertTrue(p.url.endswith(self.app_name + '.spl'))
# Assert string due to deprecation of this property in new Splunk versions
self.assertIsInstance(p.url, str)

def test_updateInfo(self):
p = self.app.updateInfo()
Expand Down

0 comments on commit d1553e5

Please sign in to comment.