Skip to content

Commit

Permalink
Regex update and sealed removed.
Browse files Browse the repository at this point in the history
- Make `.` optional in the regex. Also, remove `sealed` class tests.
  • Loading branch information
mavaddat authored and rgrunber committed Apr 1, 2024
1 parent 93e0a42 commit 293b603
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/scripts/check_and_update_jdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Query the Oracle website for the latest JDK version
response = requests.get('http://javadl-esd-secure.oracle.com/update/baseline.version')
latest_jdk = re.search(r'(?P<major>\d+)\.', response.text)
latest_jdk = re.search(r'(?P<major>\d+)\.?', response.text)
if latest_jdk is None:
print('Failed to retrieve latest JDK version')
exit(1)
Expand All @@ -33,10 +33,6 @@
uri_base = 'https://ci.eclipse.org/ls/job/jdt-ls-master/lastCompletedBuild/testReport/org.eclipse.jdt.ls.core.internal.{package}/{java_class}/{method}/api/python'
# Define the test URLs to check using the template and list comprehension
tests = [
uri_base.format(package='correction', java_class='ModifierCorrectionsQuickFixTest', method=m) for m in ['testAddSealedMissingClassModifierProposal', 'testAddSealedAsDirectSuperClass', 'testAddPermitsToDirectSuperClass']
] + [
uri_base.format(package='correction', java_class='UnresolvedTypesQuickFixTest', method='testTypeInSealedTypeDeclaration')
] + [
uri_base.format(package='managers', java_class=c, method=m) for c, m in [('EclipseProjectImporterTest', 'testPreviewFeaturesDisabledByDefault'), ('InvisibleProjectImporterTest', 'testPreviewFeaturesEnabledByDefault'), ('MavenProjectImporterTest', f'testJava{latest_jdk}Project')]
]

Expand All @@ -61,11 +57,11 @@

# Replace the ~ with current_jdk
readme_ver_pattern = re.sub('~', current_jdk, readme_ver_pattern)

# Write this to a file for the create-pull-request workflow
with open('latest_jdk.txt', 'w') as f:
f.write(latest_jdk)

# Replace the current supported JDK version with the latest JDK version
readme = re.sub(readme_ver_pattern, latest_jdk, readme)

Expand Down

0 comments on commit 293b603

Please sign in to comment.