summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications/lang
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-10-27 04:09:52 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2020-10-27 04:09:52 +0000
commit8956e668cc3b4088a7bdd3d82ca99ac1445c8814 (patch)
tree0fa7bfbcfb2cde634ed52594159c5d79f806a98b /test/unit/applications/lang
parent434c3228d9bbdc31ff15be470a814344e5f13a4e (diff)
downloadunit-8956e668cc3b4088a7bdd3d82ca99ac1445c8814.tar.gz
unit-8956e668cc3b4088a7bdd3d82ca99ac1445c8814.tar.bz2
Tests: fixed isolation detection.
Diffstat (limited to 'test/unit/applications/lang')
-rw-r--r--test/unit/applications/lang/java.py12
-rw-r--r--test/unit/applications/lang/node.py5
2 files changed, 13 insertions, 4 deletions
diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py
index a034d9a4..0aa1a7af 100644
--- a/test/unit/applications/lang/java.py
+++ b/test/unit/applications/lang/java.py
@@ -9,7 +9,7 @@ from unit.applications.proto import TestApplicationProto
class TestApplicationJava(TestApplicationProto):
- def load(self, script, name='app', **kwargs):
+ def prepare_env(self, script):
app_path = option.temp_dir + '/java'
web_inf_path = app_path + '/WEB-INF/'
classes_path = web_inf_path + 'classes/'
@@ -75,6 +75,9 @@ class TestApplicationJava(TestApplicationProto):
except:
pytest.fail('Cann\'t run javac process.')
+ def load(self, script, **kwargs):
+ self.prepare_env(script)
+
self._load_conf(
{
"listeners": {"*:7080": {"pass": "applications/" + script}},
@@ -83,8 +86,11 @@ class TestApplicationJava(TestApplicationProto):
"unit_jars": option.current_dir + '/build',
"type": 'java',
"processes": {"spare": 0},
- "working_directory": script_path,
- "webapp": app_path,
+ "working_directory": option.test_dir
+ + '/java/'
+ + script
+ + '/',
+ "webapp": option.temp_dir + '/java',
}
},
},
diff --git a/test/unit/applications/lang/node.py b/test/unit/applications/lang/node.py
index 4aa9eb1c..98fd9ffc 100644
--- a/test/unit/applications/lang/node.py
+++ b/test/unit/applications/lang/node.py
@@ -7,7 +7,7 @@ from unit.applications.proto import TestApplicationProto
class TestApplicationNode(TestApplicationProto):
- def load(self, script, name='app.js', **kwargs):
+ def prepare_env(self, script):
# copy application
shutil.copytree(
@@ -23,6 +23,9 @@ class TestApplicationNode(TestApplicationProto):
public_dir(option.temp_dir + '/node')
+ def load(self, script, name='app.js', **kwargs):
+ self.prepare_env(script)
+
self._load_conf(
{
"listeners": {