You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2015/01/28 05:36:44 UTC
[06/50] trafficserver-qa git commit: misc fixes
misc fixes
- De-dupe some env keys for build cache
- make sure all layout dirs exist on creation/clone
- use traffic_server instead of traffic_cop (for now)
Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/103e70b3
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/103e70b3
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/103e70b3
Branch: refs/heads/master
Commit: 103e70b3e9344f3d45d812bf366ad0fd35ea6e2e
Parents: 6545cc1
Author: Thomas Jackson <ja...@gmail.com>
Authored: Mon Dec 22 18:02:03 2014 -0800
Committer: Thomas Jackson <ja...@gmail.com>
Committed: Mon Dec 22 18:02:03 2014 -0800
----------------------------------------------------------------------
tsqa/environment.py | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/103e70b3/tsqa/environment.py
----------------------------------------------------------------------
diff --git a/tsqa/environment.py b/tsqa/environment.py
index 7f70d10..2a5a5ea 100644
--- a/tsqa/environment.py
+++ b/tsqa/environment.py
@@ -103,7 +103,17 @@ class EnvironmentFactory(object):
else:
env = merge_dicts(self.default_env, env)
+ # blacklist a few things from env, so as to de-dupe builds with diffs of
+ # only these keys
+ # TODO: only de-dupe for get_key?? for now we don't care since all of these
+ # have no effect on build, but if we add one that does we'll care
+ for blacklisted_key in ('PWD', 'OLDPWD'): # TODO: global?
+ if blacklisted_key in env:
+ del env[blacklisted_key]
+
key = self._get_key(configure, env)
+ # TODO: remove
+ print 'Key is:', key, 'args are:', configure, env
# if we don't have it built already, lets build it
if key not in self.environment_stash:
@@ -149,7 +159,6 @@ class EnvironmentFactory(object):
return ret
-# TODO: make this more configurable??
class Layout:
"""
The Layout class is responsible for the set of installation paths within a
@@ -204,9 +213,10 @@ class Layout:
class Environment:
def __exec_cop(self):
- path = os.path.join(self.layout.bindir, 'traffic_cop')
+ path = os.path.join(self.layout.bindir, 'traffic_server') # make traffic_cop
logfile = os.path.join(self.layout.logdir, 'cop.log')
- cmd = [path, '--debug', '--stdout']
+ #cmd = [path, '--debug', '--stdout'] # TODO: re-enable when traffic_cop
+ cmd = [path]
environ = copy.copy(os.environ)
environ['TS_ROOT'] = self.layout.prefix
@@ -246,9 +256,6 @@ class Environment:
else:
os.makedirs(self.layout.prefix)
- for d in ('logdir', 'runtimedir', 'sysconfdir'):
- os.makedirs(getattr(self.layout, d))
-
# Make any other directories we need.
os.makedirs(os.path.join(self.layout.sysconfdir, "body_factory"))
@@ -270,6 +277,12 @@ class Environment:
ignore=None,
)
+ # make sure that all suffixes in new layout exist
+ for name in self.layout.suffixes:
+ dirname = getattr(self.layout, name)
+ if not os.path.exists(dirname):
+ os.makedirs(dirname)
+
self.overrides = {
'proxy.config.config_dir': self.layout.sysconfdir,
'proxy.config.body_factory.template_sets_dir': os.path.join(self.layout.sysconfdir, 'body_factory'),