@@ -141,11 +141,9 @@ async def test_descendants(cli: CLI) -> None:
141141
142142@pytest .mark .asyncio
143143async def test_search_source (cli : CLIService ) -> None :
144- result = await cli .execute_cli_command ('search is("foo") and some_int==0 --> identifier =~"9_"' , list_sink )
144+ result = await cli .execute_cli_command ('search is("foo") and some_int==0 --> id =~"9_"' , list_sink )
145145 assert len (result [0 ]) == 10
146- await cli .dependencies .template_expander .put_template (
147- Template ("test" , 'is(foo) and some_int==0 --> identifier=~"{{fid}}"' )
148- )
146+ await cli .dependencies .template_expander .put_template (Template ("test" , 'is(foo) and some_int==0 --> id=~"{{fid}}"' ))
149147 result2 = await cli .execute_cli_command ('search expand(test, fid="9_")' , list_sink )
150148 assert len (result2 [0 ]) == 10
151149
@@ -502,7 +500,7 @@ async def test_kinds_command(cli: CLI, foo_model: Model) -> None:
502500 "properties" : {
503501 "age" : "duration" ,
504502 "ctime" : "datetime" ,
505- "identifier " : "string" ,
503+ "id " : "string" ,
506504 "kind" : "string" ,
507505 "name" : "string" ,
508506 "now_is" : "datetime" ,
@@ -538,12 +536,12 @@ async def test_kinds_command(cli: CLI, foo_model: Model) -> None:
538536async def test_sort_command (cli : CLI ) -> None :
539537 async def identifiers (query : str ) -> List [str ]:
540538 result = await cli .execute_cli_command (query + " | dump" , list_sink )
541- return [r ["reported" ]["identifier " ] for r in result [0 ]]
539+ return [r ["reported" ]["id " ] for r in result [0 ]]
542540
543- id_wo = await identifiers ("search is(bla) | sort identifier " )
544- id_asc = await identifiers ("search is(bla) | sort identifier asc" )
545- id_desc = await identifiers ("search is(bla) | sort identifier desc" )
546- id_kind = await identifiers ("search is(bla) | sort identifier | sort kind" )
541+ id_wo = await identifiers ("search is(bla) | sort id " )
542+ id_asc = await identifiers ("search is(bla) | sort id asc" )
543+ id_desc = await identifiers ("search is(bla) | sort id desc" )
544+ id_kind = await identifiers ("search is(bla) | sort id | sort kind" )
547545 assert id_wo == id_asc
548546 assert id_wo == id_kind
549547 assert id_asc == list (reversed (id_desc ))
@@ -553,27 +551,27 @@ async def identifiers(query: str) -> List[str]:
553551async def test_limit_command (cli : CLI ) -> None :
554552 async def identifiers (query : str ) -> List [str ]:
555553 result = await cli .execute_cli_command (query + " | dump" , list_sink )
556- return [r ["reported" ]["identifier " ] for r in result [0 ]]
554+ return [r ["reported" ]["id " ] for r in result [0 ]]
557555
558- assert await identifiers ("search is(bla) sort identifier | limit 1" ) == ["0_0" ]
559- assert await identifiers ("search is(bla) sort identifier | limit 2" ) == ["0_0" , "0_1" ]
560- assert await identifiers ("search is(bla) sort identifier | limit 2, 2" ) == ["0_2" , "0_3" ]
561- assert await identifiers ("search is(bla) sort identifier | limit 10, 2" ) == ["1_0" , "1_1" ]
562- assert await identifiers ("search is(bla) sort identifier | limit 100, 2" ) == []
556+ assert await identifiers ("search is(bla) sort id | limit 1" ) == ["0_0" ]
557+ assert await identifiers ("search is(bla) sort id | limit 2" ) == ["0_0" , "0_1" ]
558+ assert await identifiers ("search is(bla) sort id | limit 2, 2" ) == ["0_2" , "0_3" ]
559+ assert await identifiers ("search is(bla) sort id | limit 10, 2" ) == ["1_0" , "1_1" ]
560+ assert await identifiers ("search is(bla) sort id | limit 100, 2" ) == []
563561
564562
565563@pytest .mark .asyncio
566564async def test_list_command (cli : CLI ) -> None :
567- result = await cli .execute_cli_command ('search is (foo) and identifier =="4" sort some_int | list' , list_sink )
565+ result = await cli .execute_cli_command ('search is (foo) and id =="4" sort some_int | list' , list_sink )
568566 assert len (result [0 ]) == 1
569- assert result [0 ][0 ].startswith ("kind=foo, identifier =4, some_int=0, age=" )
567+ assert result [0 ][0 ].startswith ("kind=foo, id =4, some_int=0, age=" )
570568 list_cmd = "list some_int as si, some_string"
571- result = await cli .execute_cli_command (f'search is (foo) and identifier =="4" | { list_cmd } ' , list_sink )
569+ result = await cli .execute_cli_command (f'search is (foo) and id =="4" | { list_cmd } ' , list_sink )
572570 assert result [0 ] == ["si=0, some_string=hello" ]
573571
574572 # list is added automatically when no output renderer is defined and has the same behaviour as if it was given
575- result = await cli .execute_cli_command ('search is (foo) and identifier =="4" sort some_int' , list_sink )
576- assert result [0 ][0 ].startswith ("kind=foo, identifier =4, some_int=0, age=" )
573+ result = await cli .execute_cli_command ('search is (foo) and id =="4" sort some_int' , list_sink )
574+ assert result [0 ][0 ].startswith ("kind=foo, id =4, some_int=0, age=" )
577575
578576 # List is using the correct type
579577 props = dict (id = "test" , a = "a" , b = True , c = False , d = None , e = 12 , f = 1.234 , reported = {})
@@ -964,7 +962,7 @@ async def test_pagerduty_alias(cli: CLI, echo_http_server: Tuple[int, List[Tuple
964962 "severity" : "warning" ,
965963 "component" : "Fix" ,
966964 "custom_details" : {
967- "collector" : {"sub_root" : {"no-region" : {"0_0" : {"id" : None , "name" : "yes or no" , "kind" : "bla" }}}}
965+ "collector" : {"sub_root" : {"no-region" : {"0_0" : {"id" : "0_0" , "name" : "yes or no" , "kind" : "bla" }}}}
968966 },
969967 },
970968 "routing_key" : "123" ,
@@ -1435,7 +1433,7 @@ async def exec(cmd: str) -> List[JsonElement]:
14351433 in_one_min = utc_str (now + timedelta (minutes = 1 ))
14361434 one_min_ago = utc_str (now - timedelta (minutes = 1 ))
14371435 # Create a time series based on all foo entries
1438- res = await exec ("timeseries snapshot --name test 'search aggregate(reported.some_int, reported.identifier : sum(1)): is(foo)'" ) # fmt: skip
1436+ res = await exec ("timeseries snapshot --name test 'search aggregate(reported.some_int, reported.id : sum(1)): is(foo)'" ) # fmt: skip
14391437 assert res [0 ] == "10 entries added to time series test."
14401438 # Get the time series combined with each complete group
14411439 res = await exec (f"timeseries get --name test --start { one_min_ago } --end { in_one_min } " )
@@ -1446,11 +1444,11 @@ async def exec(cmd: str) -> List[JsonElement]:
14461444 # Combine over some_int (which has only one) --> only one entry for one timestamp
14471445 res = await exec (f"timeseries get --name test --start { one_min_ago } --end { in_one_min } --group some_int" )
14481446 assert len (res ) == 1
1449- # Combine over identifier (which is unique for each entry) --> 10 entries for one timestamp
1450- res = await exec (f"timeseries get --name test --start { one_min_ago } --end { in_one_min } --group identifier " )
1447+ # Combine over id (which is unique for each entry) --> 10 entries for one timestamp
1448+ res = await exec (f"timeseries get --name test --start { one_min_ago } --end { in_one_min } --group id " )
14511449 assert len (res ) == 10
1452- # Combine over identifier (which is unique for each entry), filter for identifier ==2 --> 1 entry for one timestamp
1453- res = await exec (f'timeseries get --name test --start { one_min_ago } --end { in_one_min } --group identifier --filter identifier =="2"' ) # fmt: skip
1450+ # Combine over id (which is unique for each entry), filter for id ==2 --> 1 entry for one timestamp
1451+ res = await exec (f'timeseries get --name test --start { one_min_ago } --end { in_one_min } --group id --filter id =="2"' ) # fmt: skip
14541452 assert len (res ) == 1
14551453
14561454
0 commit comments