Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify tests to work with svn 1.14 #275

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Conversation

dpmatthews
Copy link
Member

@dpmatthews dpmatthews commented Aug 8, 2022

Also

  • Replace Ubuntu 18.04 with 22.04 in github actions
  • Skip tests which are broken with svn 1.13.0 (Ubuntu 20.04)
  • Use Python 3 (not 2) in tests

@dpmatthews dpmatthews added this to the next-release milestone Aug 8, 2022
@dpmatthews
Copy link
Member Author

Ubuntu 22.04 uses svn 1.14.1 so shouldn't be affected by the svn bug which causes failures with 20.04 (see #267)

@dpmatthews
Copy link
Member Author

svn 1.11+ contains improvements to the handling of tree conflicts.
https://subversion.apache.org/docs/release-notes/1.14.html#conflict-resolver
Some of the tests which previously resulted in a tree conflict now just result in a text conflict. The tests have been adapted to reflect this.

@dpmatthews dpmatthews changed the title Add ubuntu-22.04 to github actions Modify tests to work with svn 1.14 Dec 13, 2023
@@ -5,12 +5,12 @@ jobs:
strategy:
fail-fast: False
matrix:
ubuntu: ['ubuntu-18.04', 'ubuntu-20.04']
ubuntu: ['ubuntu-20.04', 'ubuntu-22.04']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ubuntu-latest?

Sadly, there isn't the option of doing `['ubuntu-earliest', 'unbuntu-second-latest', 'ubuntu-latest']

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason - I just prefer to be explicit

text = sys.stdin.read()
sending_lines = re.findall("^\w+ing +.*$", text, re.M)
prefix = text[:text.index(sending_lines[0])]
suffix = text[(text.index(sending_lines[-1]) + len(sending_lines[-1])):]
sending_lines.sort()
print prefix + "\n".join(sending_lines) + suffix.rstrip()
print (prefix + "\n".join(sending_lines) + suffix.rstrip())
Copy link
Contributor

@wxtim wxtim Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space between print and ( is valid but looks odd.

expected:

Suggested change
print (prefix + "\n".join(sending_lines) + suffix.rstrip())
print(prefix + "\n".join(sending_lines) + suffix.rstrip())

@@ -234,13 +251,13 @@ function commit_sort() {
# Sort the svn status part of the message
status_sort $INPUT_FILE $TMP_OUTPUT_FILE
# Sort the 'Adding/Deleting', etc part of the message
python2 -c 'import re, sys
python3 -c 'import re, sys
text = sys.stdin.read()
sending_lines = re.findall("^\w+ing +.*$", text, re.M)
Copy link
Contributor

@wxtim wxtim Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll get syntax deprecation warnings with this.

sed -i 's@(re\..*\()"@$1r"@g' t/lib/bash/test_header

e.g.

> ./bin/fcm_test_battery t/fcm-commit/00-simple.t 
t/fcm-commit/00-simple.t .. 1/3 <string>:3: SyntaxWarning: invalid escape sequence '\w'
<string>:3: SyntaxWarning: invalid escape sequence '\w'
t/fcm-commit/00-simple.t .. ok   
All tests successful.
Files=1, Tests=3,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.44 cusr  0.44 csys =  0.91 CPU)
Result: PASS

https://stackoverflow.com/questions/50504500/deprecationwarning-invalid-escape-sequence-what-to-use-instead-of-d

Copy link
Contributor

@wxtim wxtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 2→3

In descending order of importance:

  • re.????("...re.????(r"...: Important if you don't want warning messages.
  • print ("print(": not an essential change, but it looks odd to my eye.
  • Investigated that list.sort() behaves the same way for the Python 3 (just in case).

SVN tests

I have had a skim read through the *.t files. I'm not super familiar with FCM/SVN output: I can do a more detailed review if you want, but that would involve considerable learning, and I think will hit the law of diminishing returns.

Modify tests to work with svn 1.14
Skip tests which are broken with svn 1.13.0 (Ubuntu 20.04)
Use Python 3 (not 2) in tests
@dpmatthews dpmatthews merged commit 91a7b0d into metomi:master Dec 13, 2023
2 checks passed
@dpmatthews dpmatthews deleted the ubuntu-2204 branch December 13, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants