-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add csharp compatibility tests between last released and the current …
…version (#6407) * Add csharp compatibility tests for 3.7.0 * Add compatibility test between last major version with current for C# * Update last version number * compatibility tests between last released and the current version * fix typo
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env python | ||
# Usage: ./update_compatibility_version.py <MAJOR>.<MINOR>.<MICRO> [<RC version>] | ||
# | ||
# Example: | ||
# ./update_compatibility_version.py 3.7.1 | ||
|
||
import datetime | ||
import re | ||
import sys | ||
from xml.dom import minidom | ||
|
||
if len(sys.argv) < 2 or len(sys.argv) > 3: | ||
print """ | ||
[ERROR] Please specify a version. | ||
./update_version.py <MAJOR>.<MINOR>.<MICRO> [<RC version>] | ||
Example: | ||
./update_version.py 3.7.1 2 | ||
""" | ||
exit(1) | ||
|
||
NEW_VERSION = sys.argv[1] | ||
NEW_VERSION_INFO = NEW_VERSION.split('.') | ||
if len(NEW_VERSION_INFO) != 3: | ||
print """ | ||
[ERROR] Version must be in the format <MAJOR>.<MINOR>.<MICRO> | ||
Example: | ||
./update_version.py 3.7.3 | ||
""" | ||
exit(1) | ||
|
||
if len(sys.argv) > 2: | ||
RC_VERSION = int(sys.argv[2]) | ||
# Do not update compatibility versions for rc release | ||
if RC_VERSION != 0: | ||
exit(0) | ||
|
||
def RewriteTextFile(filename, line_rewriter): | ||
lines = open(filename, 'r').readlines() | ||
updated_lines = [] | ||
for line in lines: | ||
updated_lines.append(line_rewriter(line)) | ||
if lines == updated_lines: | ||
print '%s was not updated. Please double check.' % filename | ||
f = open(filename, 'w') | ||
f.write(''.join(updated_lines)) | ||
f.close() | ||
|
||
|
||
def UpdateCsharp(): | ||
RewriteTextFile('csharp/compatibility_tests/v3.0.0/test.sh', | ||
lambda line : re.sub( | ||
r'LAST_RELEASED=.*$', | ||
'LAST_RELEASED=%s' % NEW_VERSION, | ||
line)) | ||
|
||
def UpdateTests(): | ||
RewriteTextFile('tests.sh', | ||
lambda line : re.sub( | ||
r'LAST_RELEASED=.*$', | ||
'LAST_RELEASED=%s' % NEW_VERSION, | ||
line)) | ||
|
||
|
||
UpdateCsharp() | ||
UpdateTests() |