No bug: [taskgraph] Simplify one of the docker tests; r=dustin
authorTom Prince <mozilla@hocat.ca>
Fri, 18 Jan 2019 20:08:06 +0000
changeset 511591 1e0f41f31abe7f400525b736151cbbb73b83d4fd
parent 511590 19b949191e5c5680fca1edae111352eaa0a688aa
child 511592 2227c747a95b2e907460217a3c0860f54cf36243
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug: [taskgraph] Simplify one of the docker tests; r=dustin Differential Revision: https://phabricator.services.mozilla.com/D17010
taskcluster/taskgraph/test/test_util_docker.py
--- a/taskcluster/taskgraph/test/test_util_docker.py
+++ b/taskcluster/taskgraph/test/test_util_docker.py
@@ -20,36 +20,33 @@ from mozunit import main, MockedOpen
 MODE_STANDARD = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
 
 
 @mock.patch.dict('os.environ', {'TASKCLUSTER_ROOT_URL': liburls.test_root_url()})
 class TestDocker(unittest.TestCase):
 
     def test_generate_context_hash(self):
         tmpdir = tempfile.mkdtemp()
-        old_GECKO = docker.GECKO
-        docker.GECKO = tmpdir
         try:
             os.makedirs(os.path.join(tmpdir, 'docker', 'my-image'))
             p = os.path.join(tmpdir, 'docker', 'my-image', 'Dockerfile')
             with open(p, 'w') as f:
                 f.write("FROM node\nADD a-file\n")
             os.chmod(p, MODE_STANDARD)
             p = os.path.join(tmpdir, 'docker', 'my-image', 'a-file')
             with open(p, 'w') as f:
                 f.write("data\n")
             os.chmod(p, MODE_STANDARD)
             self.assertEqual(
-                docker.generate_context_hash(docker.GECKO,
-                                             os.path.join(docker.GECKO, 'docker/my-image'),
+                docker.generate_context_hash(tmpdir,
+                                             os.path.join(tmpdir, 'docker/my-image'),
                                              'my-image'),
                 'e61e675ce05e8c11424437db3f1004079374c1a5fe6ad6800346cebe137b0797'
             )
         finally:
-            docker.GECKO = old_GECKO
             shutil.rmtree(tmpdir)
 
     def test_docker_image_explicit_registry(self):
         files = {}
         files["{}/myimage/REGISTRY".format(docker.IMAGE_DIR)] = "cool-images"
         files["{}/myimage/VERSION".format(docker.IMAGE_DIR)] = "1.2.3"
         files["{}/myimage/HASH".format(docker.IMAGE_DIR)] = "sha256:434..."
         with MockedOpen(files):