Переглянути джерело

Improve run-ci's change detection

Ensure that the prefix matches the directory. Using the
entire string results in things like 'php' being run when only
'cakephp' was modified
Hamilton Turner 11 роки тому
батько
коміт
8174939faa
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      toolset/run-ci.py

+ 2 - 2
toolset/run-ci.py

@@ -82,14 +82,14 @@ class CIRunnner:
     '''
     '''
 
 
     # Look for changes to core TFB framework code
     # Look for changes to core TFB framework code
-    find_tool_changes = "git diff --name-only %s | grep toolset | wc -l" % self.commit_range
+    find_tool_changes = "git diff --name-only %s | grep '^toolset' | wc -l" % self.commit_range
     changes = subprocess.check_output(find_tool_changes, shell=True)  
     changes = subprocess.check_output(find_tool_changes, shell=True)  
     if int(changes) != 0:
     if int(changes) != 0:
       log.info("Found changes to core framework code")
       log.info("Found changes to core framework code")
       return True
       return True
   
   
     # Look for changes relevant to this test
     # Look for changes relevant to this test
-    find_test_changes = "git diff --name-only %s | grep %s | wc -l" % (self.commit_range, self.test.directory)
+    find_test_changes = "git diff --name-only %s | grep '^%s' | wc -l" % (self.commit_range, self.test.directory)
     changes = subprocess.check_output(find_test_changes, shell=True)
     changes = subprocess.check_output(find_test_changes, shell=True)
     if int(changes) == 0:
     if int(changes) == 0:
       log.info("No changes found for %s", self.name)
       log.info("No changes found for %s", self.name)