Skip to content

Commit

Permalink
Forward all stdout and stderr output to TestKit (neo4j#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude authored Apr 6, 2023
1 parent 1f1c154 commit 1980add
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
2 changes: 2 additions & 0 deletions testkit/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
Assumes driver and backend has been built.
Responsible for starting the test backend.
"""

import os
import subprocess
import sys


if __name__ == "__main__":
backend_path = os.path.join(".", "testkit-backend")
subprocess.check_call(["go", "run", "-buildvcs=false", backend_path],
Expand Down
8 changes: 6 additions & 2 deletions testkit/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
Executed in Go driver container.
Responsible for building driver and test backend.
"""

import sys
from pathlib import Path
import os
import subprocess


def run(args, env=None):
subprocess.run(args, universal_newlines=True, stderr=subprocess.STDOUT,
check=True, env=env)
subprocess.run(
args, universal_newlines=True, check=True, env=env,
stdout=sys.stdout, stderr=sys.stderr,
)


if __name__ == "__main__":
Expand Down
7 changes: 5 additions & 2 deletions testkit/integration.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import os
import subprocess
import sys


def run(args):
subprocess.run(args, universal_newlines=True, stderr=subprocess.STDOUT,
check=True)
subprocess.run(
args, universal_newlines=True, check=True,
stdout=sys.stdout, stderr=sys.stderr,
)


if __name__ == "__main__":
Expand Down
9 changes: 7 additions & 2 deletions testkit/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
Responsible for running stress tests.
Assumes driver has been setup by build script prior to this.
"""

import os
import subprocess
import sys


root_package = "github.com/neo4j/neo4j-go-driver"
ROOT_PACKAGE = "github.com/neo4j/neo4j-go-driver"


def run(args):
subprocess.run(
args, universal_newlines=True, stderr=subprocess.STDOUT, check=True)
args, universal_newlines=True, check=True,
stdout=sys.stdout, stderr=sys.stderr,
)


if __name__ == "__main__":
Expand Down
11 changes: 8 additions & 3 deletions testkit/unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
Responsible for running unit tests.
Assumes driver has been setup by build script prior to this.
"""

import os
import subprocess
import sys


def run(args):
subprocess.run(args, universal_newlines=True, stderr=subprocess.STDOUT,
check=True)
subprocess.run(
args, universal_newlines=True, check=True,
stdout=sys.stdout, stderr=sys.stderr,
)


if __name__ == "__main__":
Expand All @@ -22,4 +26,5 @@ def run(args):
run(cmd + ["-buildvcs=false", "-short", "./..."])

# Repeat racing tests
run(cmd + ["-buildvcs=false", "-race", "-count", "50", "./neo4j/internal/racing"])
run(cmd + ["-buildvcs=false", "-race", "-count", "50",
"./neo4j/internal/racing"])

0 comments on commit 1980add

Please sign in to comment.