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

Empty Parser Fix #11391

Merged
merged 1 commit into from
Nov 7, 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
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
Loading