Skip to content

Commit

Permalink
Merge pull request #67 from ActivityWatch/dev/server-next
Browse files Browse the repository at this point in the history
Major server refactoring
  • Loading branch information
ErikBjare authored Jun 14, 2017
2 parents c90a1a9 + 8a428e1 commit f5cf0e2
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 91 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
build
dist
__pycache__
.*cache

# Old repo
activity-watch

.idea
venv*
old
other
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ uninstall:

test:
make --directory=aw-core test
make --directory=aw-server test
make --directory=aw-qt test

test-integration:
Expand Down
2 changes: 1 addition & 1 deletion aw-client
Submodule aw-client updated 2 files
+1 −0 .gitignore
+44 −34 aw_client/client.py
2 changes: 1 addition & 1 deletion aw-qt
Submodule aw-qt updated 3 files
+2 −1 Makefile
+21 −2 aw-qt.spec
+ img/logo.ico
2 changes: 1 addition & 1 deletion aw-watcher-afk
2 changes: 1 addition & 1 deletion aw-watcher-window
2 changes: 1 addition & 1 deletion aw-webui
68 changes: 0 additions & 68 deletions scripts/contributor-stats.py

This file was deleted.

31 changes: 15 additions & 16 deletions scripts/tests/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ def server_process():
logfile_stdout = tempfile.NamedTemporaryFile(delete=False)
logfile_stderr = tempfile.NamedTemporaryFile(delete=False)

@contextmanager
def _cm_server_process():
server_proc = subprocess.Popen(["aw-server", "--testing"], stdout=logfile_stdout, stderr=logfile_stderr)
sleep(2) # Startup time
yield server_proc
sleep(2) # Cleanup time, could probably be removed once tests are synchronous
if platform.system() == "Windows":
# On Windows, for whatever reason, server_proc.kill() doesn't do the job.
_windows_kill_process(server_proc.pid)
else:
server_proc.kill()
server_proc.wait(5)
server_proc.communicate()

with _cm_server_process() as server_proc:
yield server_proc
server_proc = subprocess.Popen(["aw-server", "--testing"], stdout=logfile_stdout, stderr=logfile_stderr)

# Wait for server to start up properly
# TODO: Ping the server until it's alive to remove this sleep
sleep(5)

yield server_proc

if platform.system() == "Windows":
# On Windows, for whatever reason, server_proc.kill() doesn't do the job.
_windows_kill_process(server_proc.pid)
else:
server_proc.kill()
server_proc.wait(5)
server_proc.communicate()

error_indicators = ["ERROR"]

Expand Down

0 comments on commit f5cf0e2

Please sign in to comment.