Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 92a2646

Browse files
Denys SmirnovJuanjo Alvarez
authored andcommitted
run fixture tests in docker
Signed-off-by: Denys Smirnov <[email protected]>
1 parent 1994da2 commit 92a2646

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

driver/fixtures/fixtures_test.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/bblfsh/python-driver/driver/normalizer"
88
"gopkg.in/bblfsh/sdk.v2/sdk/driver"
99
"gopkg.in/bblfsh/sdk.v2/sdk/driver/fixtures"
10-
"os"
1110
)
1211

1312
const projectRoot = "../../"
@@ -17,14 +16,13 @@ var Suite = &fixtures.Suite{
1716
Ext: ".py",
1817
Path: filepath.Join(projectRoot, fixtures.Dir),
1918
NewDriver: func() driver.BaseDriver {
20-
return driver.NewExecDriverAt(filepath.Join(projectRoot,
21-
"build/.local/bin/python_driver"))
19+
return driver.NewExecDriverAt(filepath.Join(projectRoot, "build/bin/native"))
2220
},
2321
Transforms: normalizer.Transforms,
2422
BenchName: "issue_server101",
25-
//Docker:fixtures.DockerConfig{
26-
//Image:"python:3",
27-
//},
23+
Docker: fixtures.DockerConfig{
24+
Image: "python:3",
25+
},
2826
Semantic: fixtures.SemanticConfig{
2927
BlacklistTypes: []string{
3028
"AsyncFunctionDef",
@@ -45,17 +43,10 @@ var Suite = &fixtures.Suite{
4543
},
4644
}
4745

48-
func SetPythonPath() {
49-
os.Setenv("PYTHONPATH", filepath.Join(projectRoot,
50-
"build/.local/lib/python3.6/site-packages"))
51-
}
52-
5346
func TestPythonDriver(t *testing.T) {
54-
SetPythonPath()
5547
Suite.RunTests(t)
5648
}
5749

5850
func BenchmarkPythonDriver(b *testing.B) {
59-
SetPythonPath()
6051
Suite.RunBenchmarks(b)
6152
}

native/sh/native.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/sh
22
if [ -x "$HOME/build/.local/bin/python_driver" ]
33
then
4-
exec $HOME/build/.local/bin/python_driver
4+
python3 $HOME/build/.local/bin/python_driver
5+
elif [ -x "../../build/.local/bin/python_driver" ]
6+
then
7+
export PYTHONPATH=../../build/.local/lib/python3.6/site-packages:$PYTHONPATH
8+
python3 ../../build/.local/bin/python_driver
59
else
6-
exec python_driver
10+
python3 python_driver
711
fi

0 commit comments

Comments
 (0)