Skip to content

Commit a3994ad

Browse files
Placed the clean command in the appropriate spot and opened up another two loopbacks
1 parent 543eb9e commit a3994ad

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

testing/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
sudo ifconfig lo0 alias 127.0.1.2 up
1616
sudo ifconfig lo0 alias 127.0.1.3 up
1717
sudo ifconfig lo0 alias 127.0.1.4 up
18+
sudo ifconfig lo0 alias 127.0.1.5 up
19+
sudo ifconfig lo0 alias 127.0.1.6 up
1820

1921

2022

testing/bin/coverage

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def parse():
4343
parser = argparse.ArgumentParser(description='command line tool for quick testing commands.')
4444
parser.add_argument('--test', help='run a specific unit test')
4545
parser.add_argument('--cassandra-version', help='run tests on a specific Cassandra version')
46-
parser.add_argument('--upload', action="store_true", help='upload cobertura site to configured server')
46+
parser.add_argument('--upload', action='store_true', help='upload cobertura site to configured server')
47+
parser.add_argument('--clean', action='store_true', help='runs the maven project from a clean environment')
4748
args = parser.parse_args()
4849
return args
4950

@@ -73,6 +74,8 @@ def maybe_setup_loopbacks():
7374
execute('sudo ifconfig lo0 alias 127.0.1.2 up')
7475
execute('sudo ifconfig lo0 alias 127.0.1.3 up')
7576
execute('sudo ifconfig lo0 alias 127.0.1.4 up')
77+
execute('sudo ifconfig lo0 alias 127.0.1.5 up')
78+
execute('sudo ifconfig lo0 alias 127.0.1.6 up')
7679

7780
def maybe_upload_cobertura_site():
7881
'''
@@ -117,22 +120,31 @@ def main():
117120
maybe_setup_loopbacks()
118121

119122
# Start building the mvn command
120-
cobertura_build_command = 'mvn clean cobertura:cobertura -Pintegration'
123+
cobertura_build_command = 'mvn'
124+
125+
# Add the clean target, if asked or building the entire project
126+
if args.clean or not args.test:
127+
cobertura_build_command += ' clean'
128+
129+
# Add the cobertura target for the integration tests
130+
cobertura_build_command += ' cobertura:cobertura -Pintegration'
131+
132+
# Use a specific Cassandra version, if asked
121133
if args.cassandra_version:
122134
cobertura_build_command += ' -Dcassandra.version=%s' % args.cassandra_version
123135

124136
if args.test:
125137
# Run against a single mvn test
126-
execute('%s '
127-
'-Dmaven.test.failure.ignore=true '
128-
'-DfailIfNoTests=false '
129-
'-Dtest=%s' % (cobertura_build_command, args.test))
138+
execute('%s'
139+
' -Dmaven.test.failure.ignore=true'
140+
' -DfailIfNoTests=false'
141+
' -Dtest=%s' % (cobertura_build_command, args.test))
130142
else:
131143
# Run against the entire integration suite
132144
execute('%s' % cobertura_build_command)
133145

134146
try:
135-
if raw_input("Save Cobertura Report? [y/N] ").lower() == 'y':
147+
if raw_input('Save Cobertura Report? [y/N] ').lower() == 'y':
136148

137149
# Save out cobertura site files
138150
save_cobertura_site()
@@ -150,5 +162,5 @@ def main():
150162
print '\topen driver-core/target/site/cobertura/index.html'
151163

152164

153-
if __name__ == "__main__":
165+
if __name__ == '__main__':
154166
main()

0 commit comments

Comments
 (0)