Skip to content

Commit

Permalink
Update release scripts and other helper scripts
Browse files Browse the repository at this point in the history
* Update to use the new git environment
* Refactor naming conventions to better suit Python
* Better debug messages
* Colorize console output
* Rename some helper scripts
* Fix bug in uploading schema
* Fix bug in leaving stale temporary files around
  • Loading branch information
maniksurtani committed Nov 23, 2010
1 parent 8cefa28 commit 4fd0fcc
Show file tree
Hide file tree
Showing 6 changed files with 351 additions and 274 deletions.
File renamed without changes.
38 changes: 0 additions & 38 deletions bin/findDisabledTests.py

This file was deleted.

38 changes: 38 additions & 0 deletions bin/find_disabled_tests.py
@@ -0,0 +1,38 @@
#!/usr/bin/python
import re
import time
import sys
from utils import *

def main():
start_time = time.clock()
disabled_test_files = []

test_annotation_matcher = re.compile('^\s*@Test')
disabled_matcher = re.compile('enabled\s*=\s*false')

for test_file in GlobDirectoryWalker(get_search_path(sys.argv[0]), '*Test.java'):
tf = open(test_file)
try:
for line in tf:
if test_annotation_matcher.search(line) and disabled_matcher.search(line):
disabled_test_files.append(test_file)
break
finally:
tf.close()

print "Files containing disabled tests: \n"
unique_tests=to_set(disabled_test_files)
i = 1
for f in unique_tests:
zeropad=""
if i < 10 and len(unique_tests) > 9:
zeropad = " "
print "%s%s. %s" % (zeropad, str(i), strip_leading_dots(f))
i += 1

print "\n (finished in " + str(time.clock() - start_time) + " seconds)"

if __name__ == '__main__':
main()

22 changes: 11 additions & 11 deletions bin/listCommandIDs.py → bin/list_command_ids.py
Expand Up @@ -2,11 +2,11 @@

import re
import sys
from pythonTools import *
from utils import *

command_file_name = re.compile('(commands/[a-zA-Z0-9/]*Command.java)')

def trimName(nm):
def trim_name(nm):
res = command_file_name.search(nm)
if res:
return res.group(1)
Expand All @@ -26,14 +26,14 @@ def get_next(ids_used):

command_ids = {}
warnings = []
for testFile in GlobDirectoryWalker(getSearchPath(sys.argv[0]) + 'core/src/main/java/org/infinispan/commands', '*Command.java'):
tf = open(testFile)
for test_file in GlobDirectoryWalker(get_search_path(sys.argv[0]) + 'core/src/main/java/org/infinispan/commands', '*Command.java'):
tf = open(test_file)
try:
for line in tf:
mo = command_line_regexp.search(line)
if mo:
id = int(mo.group(1))
trimmed_name = trimName(testFile)
trimmed_name = trim_name(test_file)
if id in command_ids:
warnings.append("Saw duplicate COMMAND_IDs in files [%s] and [%s]" % (trimmed_name, command_ids[id]))
command_ids[id] = trimmed_name
Expand All @@ -42,15 +42,15 @@ def get_next(ids_used):

print 'Scanned %s Command source files. IDs are (in order):' % len(command_ids)

sortedKeys = command_ids.keys()
sortedKeys.sort()
sorted_keys = command_ids.keys()
sorted_keys.sort()

i=1
for k in sortedKeys:
for k in sorted_keys:
zeropad = ""
if (i < 10 and len(sortedKeys) > 9):
if (i < 10 and len(sorted_keys) > 9):
zeropad = " "
print ' %s%s) Class [%s] has COMMAND_ID [%s]' % (zeropad, i, command_ids[k], k)
print ' %s%s) Class [%s%s%s] has COMMAND_ID [%s%s%s]' % (zeropad, i, Colors.green(), command_ids[k], Colors.end_color(), Colors.yellow(), k, Colors.end_color())
i += 1

print "\n"
Expand All @@ -60,4 +60,4 @@ def get_next(ids_used):
print " *** %s" % w
print "\n"

print "Next available ID is %s" % get_next(sortedKeys)
print "Next available ID is %s%s%s" % (Colors.cyan(), get_next(sorted_keys), Colors.end_color())

0 comments on commit 4fd0fcc

Please sign in to comment.