diff --git a/.drone.star b/.drone.star index 181ba115ab0..060adda9592 100644 --- a/.drone.star +++ b/.drone.star @@ -408,7 +408,7 @@ def localApiTests(ctx, coreBranch = 'master', coreCommit = '', storage = 'ownclo 'PATH_TO_CORE': '/srv/app/testrunner', }, 'commands': [ - 'make -C ocis test-acceptance-api', + 'make test-acceptance-api', ], 'volumes': [{ 'name': 'gopath', diff --git a/.gitignore b/.gitignore index 7f3aa9cbe21..42c117c6437 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,10 @@ node_modules/ */yarn-error.log # Konnectd -konnectd/assets/identifier \ No newline at end of file +konnectd/assets/identifier + +# Composer - used for API acceptance tests +composer.lock +vendor +vendor-bin/**/vendor +vendor-bin/**/composer.lock diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..5ec82fbdee3 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +SHELL := bash + +.PHONY: help +help: + @echo "Please use 'make ' where is one of the following:" + @echo + @echo -e "Testing:\n" + @echo -e "make test-acceptance-api\trun API acceptance tests" + @echo -e "make clean-tests\t\tdelete API tests framework dependencies" + @echo + @echo -e "See the Makefile in the ocis folder for other build and test targets" + +.PHONY: clean-tests +clean-tests: + rm -Rf vendor-bin/**/vendor vendor-bin/**/composer.lock + +BEHAT_BIN=vendor-bin/behat/vendor/bin/behat + +.PHONY: test-acceptance-api +test-acceptance-api: vendor-bin/behat/vendor + BEHAT_BIN=$(BEHAT_BIN) $(PATH_TO_CORE)/tests/acceptance/run.sh --remote --type api + +vendor/bamarni/composer-bin-plugin: composer.lock + composer install + +vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/composer.lock + composer bin behat install --no-progress + +vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json + @echo behat composer.lock is not up to date. + +composer.lock: composer.json + @echo composer.lock is not up to date. diff --git a/ocis/composer.json b/composer.json similarity index 100% rename from ocis/composer.json rename to composer.json diff --git a/ocis/Makefile b/ocis/Makefile index 87cf5746a9b..4f43bd2d599 100644 --- a/ocis/Makefile +++ b/ocis/Makefile @@ -147,21 +147,3 @@ config-docs-generate: .PHONY: watch watch: go run github.com/cespare/reflex -c reflex.conf - -BEHAT_BIN=vendor-bin/behat/vendor/bin/behat - -.PHONY: test-acceptance-api -test-acceptance-api: vendor-bin/behat/vendor - BEHAT_BIN=$(BEHAT_BIN) $(PATH_TO_CORE)/tests/acceptance/run.sh --remote --type api - -vendor/bamarni/composer-bin-plugin: composer.lock - composer install - -vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/composer.lock - composer bin behat install --no-progress - -vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json - @echo behat composer.lock is not up to date. - -composer.lock: composer.json - @echo composer.lock is not up to date. diff --git a/ocis/vendor-bin/behat/composer.json b/vendor-bin/behat/composer.json similarity index 100% rename from ocis/vendor-bin/behat/composer.json rename to vendor-bin/behat/composer.json