From ce1999307801c7deb0e1fbdd9c8a3e4f9c95b563 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Sun, 14 Feb 2021 11:12:30 -0600 Subject: [PATCH] Makefile: Improve test target --- .github/workflows/test.yml | 6 +++--- Makefile | 12 +++++++++--- src/python/notes_test.py | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9aea1a0..6fc2dc3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,8 @@ -name: Test +name: Build & Test on: [ push, pull_request ] jobs: test: - name: Test + name: Build & Test runs-on: ubuntu-latest steps: - name: Check out source code @@ -26,4 +26,4 @@ jobs: run: make - name: Run tests - run: make run & make large-tests \ No newline at end of file + run: make test diff --git a/Makefile b/Makefile index a11e446..e84df9e 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,12 @@ install-deps: run: cd build && ./notes -.PHONY: large-tests -large-tests: - pytest \ No newline at end of file +.PHONY: test +test: all + @cd build ;\ + ./notes --port=8040 &\ + NOTES_PID=$$! ;\ + pytest .. ;\ + PYTEST_RESULT=$$? ;\ + kill $$NOTES_PID ;\ + exit $$PYTEST_RESULT diff --git a/src/python/notes_test.py b/src/python/notes_test.py index 28e256c..200138d 100644 --- a/src/python/notes_test.py +++ b/src/python/notes_test.py @@ -3,7 +3,7 @@ from time import sleep from selenium import webdriver from selenium.webdriver.chrome.options import Options -INDEX_URL = "http://localhost:8050" +INDEX_URL = "http://localhost:8040" def _launch():