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

[READY] Correct where WithRetry decorator is applied #1773

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ycmd/tests/clangd/subcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ def FixIt_Check_AutoExpand_Resolved( results ):
} ) )


@WithRetry()
def RunRangedFixItTest( app, rng, expected, chosen_fixit = 0 ):
contents = ReadFile( PathToTestFile( 'FixIt_Clang_cpp11.cpp' ) )
args = {
Expand Down Expand Up @@ -616,7 +617,6 @@ def test_Subcommands_DefinedSubcommands( self, app ):
} )


@WithRetry()
@SharedYcmd
def test_Subcommands_ServerNotInitialized( self, app ):
for cmd in [
Expand Down Expand Up @@ -646,6 +646,7 @@ def test_Subcommands_ServerNotInitialized( self, app ):
with self.subTest( cmd = cmd ):
completer = handlers._server_state.GetFiletypeCompleter( [ 'cpp' ] )

@WithRetry()
@patch.object( completer, '_ServerIsInitialized', return_value = False )
def Test( app, cmd, *args ):
request = {
Expand Down Expand Up @@ -1177,7 +1178,6 @@ def test_Subcommands_FixIt_all( self, app ):
RunFixItTest( app, line, column, language, filepath, check )


@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_Ranged( self, app ):
for test in [
Expand Down Expand Up @@ -1237,7 +1237,6 @@ def test_Subcommands_FixIt_AlreadyResolved( self, app ):
assert_that( actual, equal_to( expected ) )


@WithRetry()
@IsolatedYcmd( { 'clangd_args': [ '-hidden-features' ] } )
def test_Subcommands_FixIt_ClangdTweaks( self, app ):
selection = {
Expand Down
49 changes: 20 additions & 29 deletions ycmd/tests/java/subcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def RunHierarchyTest( app, kind, direction, location, expected, code ):
RunTest( app, test )


@WithRetry()
def RunFixItTest( app,
description,
filepath,
Expand Down Expand Up @@ -679,7 +680,6 @@ def test_Subcommands_GoToReferences_NoReferences( self, app ):
'Cannot jump to location' ) )


@WithRetry()
@IsolatedYcmd( {
'extra_conf_globlist': PathToTestFile( 'multiple_projects', '*' )
} )
Expand Down Expand Up @@ -722,14 +722,11 @@ def test_Subcommands_GoToReferences_MultipleProjects( self, app ):
'com',
'test',
'TestWidgetImpl.java' )
for desc, request, expect in [
for desc, filepath, line, column, expect in [
( 'GoToReferences works across multiple projects',
{
'command': 'GoToReferences',
'filepath': utils_java,
'line_num': 5,
'column_num': 22,
},
utils_java,
5,
22,
{
'response': requests.codes.ok,
'data': contains_inanyorder(
Expand All @@ -739,12 +736,9 @@ def test_Subcommands_GoToReferences_MultipleProjects( self, app ):
)
} ),
( 'GoToReferences works in an unrelated project at the same time',
{
'command': 'GoToReferences',
'filepath': abstract_test_widget,
'line_num': 10,
'column_num': 15,
},
abstract_test_widget,
10,
15,
{
'response': requests.codes.ok,
'data': contains_inanyorder(
Expand All @@ -755,16 +749,20 @@ def test_Subcommands_GoToReferences_MultipleProjects( self, app ):
)
} ),
]:
with self.subTest( desc = desc, request = request, expect = expect ):
filepath = request[ 'filepath' ]
with self.subTest( desc = desc,
filepath = filepath,
line = line,
column = column,
expect = expect ):
StartJavaCompleterServerWithFile( app, filepath )


RunTest( app, {
'description': desc,
'request': request,
'expect': expect
} )
RunGoToTest( app,
desc,
filepath,
line,
column,
'GoToReferences',
expect )


@WithRetry()
Expand Down Expand Up @@ -1102,7 +1100,6 @@ def test_Subcommands_RefactorRename_Unicode( self, app ):



@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ):
import os
Expand Down Expand Up @@ -1259,7 +1256,6 @@ def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ):
RunFixItTest( app, description, filepath, 19, column, fixits_for_line )


@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
filepath = PathToTestFile( 'simple_eclipse_project',
Expand Down Expand Up @@ -1327,7 +1323,6 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ):
filepath, 27, 12, fixits )


@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ):
filepath = PathToTestFile( 'simple_eclipse_project',
Expand Down Expand Up @@ -1404,7 +1399,6 @@ def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ):
filepath, 15, 29, fixits )


@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_MultipleDiags( self, app ):
for description, column, expect_fixits in [
Expand Down Expand Up @@ -1626,7 +1620,6 @@ def test_Subcommands_FixIt_Range( self, app ):
)


@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_NoDiagnostics( self, app ):
filepath = PathToTestFile( 'simple_eclipse_project',
Expand All @@ -1652,7 +1645,6 @@ def test_Subcommands_FixIt_NoDiagnostics( self, app ):
'chunks': instance_of( list ) } ) ) } ) )


@WithRetry()
@SharedYcmd
def test_Subcommands_FixIt_Unicode( self, app ):
fixits = has_entries( {
Expand Down Expand Up @@ -1720,7 +1712,6 @@ def test_Subcommands_FixIt_Unicode( self, app ):
TEST_JAVA, 13, 1, fixits )


@WithRetry()
@IsolatedYcmd()
def test_Subcommands_FixIt_InvalidURI( self, app ):
filepath = PathToTestFile( 'simple_eclipse_project',
Expand Down
5 changes: 1 addition & 4 deletions ycmd/tests/rust/subcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def RunHierarchyTest( app, kind, direction, location, expected, code ):
RunTest( app, test )


@WithRetry()
def RunGoToTest( app, command, test, *, project_root = 'common' ):
folder = PathToTestFile( project_root, 'src' )
filepath = os.path.join( folder, test[ 'req' ][ 0 ] )
Expand Down Expand Up @@ -423,7 +424,6 @@ def test_Subcommands_GoToType_Basic( self, app ):
RunGoToTest( app, 'GoToType', test )


@WithRetry()
@SharedYcmd
def test_Subcommands_GoTo( self, app ):
for test, command in itertools.product(
Expand All @@ -442,7 +442,6 @@ def test_Subcommands_GoTo( self, app ):
RunGoToTest( app, command, test )


@WithRetry()
@SharedYcmd
def test_Subcommands_GoToImplementation( self, app ):
for test in [
Expand All @@ -456,7 +455,6 @@ def test_Subcommands_GoToImplementation( self, app ):
RunGoToTest( app, 'GoToImplementation', test )


@WithRetry()
@SharedYcmd
def test_Subcommands_GoToImplementation_Failure( self, app ):
RunGoToTest( app,
Expand Down Expand Up @@ -587,7 +585,6 @@ def test_Subcommands_FixIt_Basic( self, app ):
} )


@WithRetry()
@IsolatedYcmd()
def test_Subcommands_GoTo_WorksAfterChangingProject( self, app ):
filepath = PathToTestFile( 'macro', 'src', 'main.rs' )
Expand Down
Loading