~alexlauni/tarmac/jenkins-job-chaining

« back to all changes in this revision

Viewing changes to tarmac/plugins/tests/test_mergedeponfile.py

  • Committer: Didier Roche
  • Date: 2011-11-30 13:13:13 UTC
  • Revision ID: didier.roche@canonical.com-20111130131313-q5oqoefa7kaihyn5
change the format to prefer a mergedep_on with a ; separated filelist text

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        
49
49
    def test_no_dep_but_option(self):
50
50
        """Test that with no build-dep, but the option checked, we wait just once"""
51
 
        target = Thing(config = Thing(mergedep_on_0="abcdefgh"))
 
51
        target = Thing(config = Thing(mergedep_on="abcdefgh"))
 
52
        start_time = time.time()
 
53
        self.plugin.run(command=None, target=target)
 
54
        end_time = time.time()
 
55
        self.assertTrue(end_time - start_time > TIME_BETWEEN_TWO_CHECKS)
 
56
        self.assertTrue(end_time - start_time < 2*TIME_BETWEEN_TWO_CHECKS)
 
57
 
 
58
    def test_no_dep_but_option_one_empty(self):
 
59
        """Test that with no build-dep, but the option checked and an empty file, we wait just once"""
 
60
        target = Thing(config = Thing(mergedep_on="abcdefgh;"))
52
61
        start_time = time.time()
53
62
        self.plugin.run(command=None, target=target)
54
63
        end_time = time.time()
57
66
        
58
67
    def test_one_dep_only(self):
59
68
        """Test that with one build-dep, we wait until test_timeout_run"""
60
 
        target = Thing(config = Thing(mergedep_on_0=self.depfile,
 
69
        target = Thing(config = Thing(mergedep_on=self.depfile,
61
70
                                      test_timeout_run=2))
62
71
        start_time = time.time()
63
72
        self.plugin.run(command=None, target=target)
67
76
 
68
77
    def test_two_deps_but_one_file(self):
69
78
        """Test that with one build-dep on two, we wait until test_timeout_run"""
70
 
        target = Thing(config = Thing(mergedep_on_0="abcdefgh",
71
 
                                      mergedep_on_1=self.depfile,
 
79
        target = Thing(config = Thing(mergedep_on="abcdefgh;%s" % self.depfile,
72
80
                                      test_timeout_run=2))
73
81
        start_time = time.time()
74
82
        self.plugin.run(command=None, target=target)
75
83
        end_time = time.time()
76
84
        self.assertTrue(end_time - start_time > 2*TIME_BETWEEN_TWO_CHECKS)
77
 
        self.assertTrue(end_time - start_time < 3*TIME_BETWEEN_TWO_CHECKS)        
 
85
        self.assertTrue(end_time - start_time < 3*TIME_BETWEEN_TWO_CHECKS)
78
86