summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Molenaar <SMillerDev@users.noreply.github.com>2022-09-28 21:07:44 +0200
committerGitHub <noreply@github.com>2022-09-28 21:07:44 +0200
commiteb7e4884bb0828fdfde25e040e2a4e3f47a4cdde (patch)
treebea3093bf108110193a2efa7738f90608d89318a
parentb521f721826cf3418a70a35cbfbe3619b2911305 (diff)
feat: start servers from make
-rw-r--r--Makefile10
-rw-r--r--docs/developer.md6
2 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3322b3b51..93fe85688 100644
--- a/Makefile
+++ b/Makefile
@@ -220,4 +220,12 @@ test: php-test-dependencies
.PHONY: feed-test
feed-test:
- ./bin/tools/check_feeds.sh \ No newline at end of file
+ ./bin/tools/check_feeds.sh
+
+.PHONY: feed-server
+feed-server:
+ php -S 0.0.0.0:8090 -t $(CURDIR)/tests/test_helper/feeds
+
+.PHONY: nextcloud-server
+nextcloud-server:
+ php -S 0.0.0.0:8080 -t $(CURDIR)/../../. \ No newline at end of file
diff --git a/docs/developer.md b/docs/developer.md
index 6dda72852..50f82db1d 100644
--- a/docs/developer.md
+++ b/docs/developer.md
@@ -41,15 +41,13 @@ You also need to pull the submodules of the news repo.
git submodules update --init
```
-The cli tests expect that the feeds are reachable at `http://localhost:8090`, to achieve that you can use the [builtin php server](https://www.php.net/manual/en/features.commandline.webserver.php).
-
-Change into the `tests/test_helpers/feeds` directory and execute `php -S localhost:8090` you can also run it in the background like this `php -S localhost:8090 &`.
+The cli tests expect that the feeds are reachable at `http://localhost:8090`, to achieve that you can use `make feed-server &` the `&` means it'll run in the background.
Now the test feeds will be reachable for bats.
Run the tests by executing `bats tests/command` you can also only run specific tests for example `bats tests/command/feeds.bats`.
For the API tests you need to run a second php server or have another web server that provides Nextcloud and the News App.
The tests expect to find Nextcloud at `http://localhost:8080`
-You can do this by running `php -S localhost:8080` in the Nextcloud server repository.
+You can do this by running `make nextcloud-server`.
The bats tests can be executed like this `bats tests/api`.