Skip to content

Commit

Permalink
last line test??
Browse files Browse the repository at this point in the history
  • Loading branch information
quadrismegistus committed Sep 24, 2023
1 parent 45bf304 commit ab94af1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: "pre-release"
name: "latest-release"

on:
push:
branches:
- "main"
- "develop"

jobs:
Expand All @@ -19,6 +18,6 @@ jobs:
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.base_ref }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
23 changes: 23 additions & 0 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "stable-release"

on:
push:
branches:
- "main"

jobs:
tests:
uses: "./.github/workflows/unit-tests.yml" # use the callable tests job to run tests

pre-release:
name: "Release"
needs: [tests]
runs-on: "ubuntu-latest"
steps:
- name: "Releasing"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "stable"
prerelease: false
title: "Stable Build"
1 change: 1 addition & 0 deletions geotaste/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def run(host=HOST, port=PORT, debug=DEBUG, url_base_pathname=ROOT_URL, dry_run=F
with Logwatch('running app'):
logger.debug(f'geotaste running at http://{host}:{port}')
if not dry_run:
print('running geotaste app')
app.run(
host=host,
port=port,
Expand Down
20 changes: 19 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import subprocess,logging
from multiprocessing import Process, Queue
import sys,os,tempfile
sys.path.insert(0,os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from geotaste.imports import *
Expand Down Expand Up @@ -301,4 +303,20 @@ def test_get_server():
app=get_app()
assert isinstance(app, DashApp)
assert isinstance(app.app, Dash)
assert isinstance(app.app.server, flask.app.Flask)
assert isinstance(app.app.server, flask.app.Flask)

def _apprun(q):
q.put(run(port=1992))


def test_run():
try:
queue = Queue()
p = Process(target=_apprun, args=(queue,))
p.start()
time.sleep(10)
p.kill()
p.join()
assert True, 'server running succeeded'
except Exception:
assert False, 'server running failed'

0 comments on commit ab94af1

Please sign in to comment.