Skip to content

Commit

Permalink
Merge pull request #11391 from Azure/Empty-Parser-Fix
Browse files Browse the repository at this point in the history
Empty Parser Fix
  • Loading branch information
manishkumar1991 authored Nov 7, 2024
2 parents a9fff40 + 6176e2e commit e0dcaf5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .script/tests/asimParsersTest/ASimFilteringTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def main():
else:
SchemaName = None
# Check if changed file is a union parser. If Yes, skip the file
if PARSER_FILE_NAME.endswith((f'ASim{SchemaName}.yaml', f'im{SchemaName}.yaml')):
if PARSER_FILE_NAME.endswith((f'ASim{SchemaName}.yaml', f'im{SchemaName}.yaml', f'vim{SchemaName}Empty.yaml')):
continue
parser_file_path = PARSER_FILE_NAME
sys.stdout.flush() # Explicitly flush stdout
Expand Down
4 changes: 2 additions & 2 deletions .script/tests/asimParsersTest/VerifyASimParserTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def run():
for parser in parser_yaml_files:

schema_name = extract_schema_name(parser)
if not schema_name or parser.endswith(f'ASim{schema_name}.yaml') or parser.endswith(f'im{schema_name}.yaml'):
print(f"{YELLOW}Skipping '{parser}' as this is a union parser file. Union parser files are not tested.{RESET}")
if parser.endswith((f'ASim{schema_name}.yaml', f'im{schema_name}.yaml', f'vim{schema_name}Empty.yaml')):
print(f"{YELLOW}Skipping '{parser}' as this is a union or empty parser file. This file won't be tested.{RESET}")
continue
# Skip vim parser file if the corresponding ASim parser file is not present
elif parser.split('/')[-1].startswith('vim'):
Expand Down
6 changes: 3 additions & 3 deletions .script/tests/asimParsersTest/ingestASimSampleData.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ def convert_data_type(schema_result, data_result):
SchemaName = SchemaNameMatch.group(1)
else:
SchemaName = None
# Check if changed file is a union parser. If Yes, skip the file
if file.endswith((f'ASim{SchemaName}.yaml', f'im{SchemaName}.yaml')):
print(f"Ignoring this {file} because it is a union parser file")
# Check if changed file is a union or empty parser. If Yes, skip the file
if file.endswith((f'ASim{SchemaName}.yaml', f'im{SchemaName}.yaml', f'vim{SchemaName}Empty.yaml')):
print(f"Ignoring this {file} because it is a union or empty parser file")
continue
print(f"Starting ingestion for sample data present in {file}")
asim_parser_url = f'{SENTINEL_REPO_RAW_URL}/{commit_number}/{file}'
Expand Down
4 changes: 2 additions & 2 deletions .script/tests/asimParsersTest/runAsimTesters.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ function testSchema([string] $ParserFile) {
}
}
$Schema = (Split-Path -Path $ParserFile -Parent | Split-Path -Parent)
if ($parsersAsObject.Parsers) {
if ($parsersAsObject.Parsers -or ($parsersAsObject.ParserName -like "*Empty")){
Write-Host "***************************************************"
Write-Host "${yellow}The parser '$functionName' is a union parser, ignoring it from 'Schema' and 'Data' testing.${reset}"
Write-Host "${yellow}The parser '$functionName' is a union or empty parser, ignoring it from 'Schema' and 'Data' testing.${reset}"
Write-Host "***************************************************"
} else {
testParser ([Parser]::new($functionName, $parsersAsObject.ParserQuery, $Schema.Replace("Parsers/ASim", ""), $parsersAsObject.ParserParams))
Expand Down

0 comments on commit e0dcaf5

Please sign in to comment.