chore: remove redundant import
This commit is contained in:
		
							parent
							
								
									a38a155975
								
							
						
					
					
						commit
						e79e66c1a7
					
				|  | @ -1,15 +1,7 @@ | ||||||
| from typing import List | from typing import List | ||||||
| 
 | 
 | ||||||
|  | from joj3_config_generator.models import joj1, repo, result, task | ||||||
| from joj3_config_generator.processers.repo import getHealthcheckConfig, getTeapotConfig | from joj3_config_generator.processers.repo import getHealthcheckConfig, getTeapotConfig | ||||||
| from joj3_config_generator.processers.task import ( |  | ||||||
|     fix_dummy, |  | ||||||
|     fix_diff, |  | ||||||
|     fix_keyword, |  | ||||||
|     fix_result_detail, |  | ||||||
|     get_conf_stage, |  | ||||||
|     get_executorWithConfig, |  | ||||||
| ) |  | ||||||
| from joj3_config_generator.models import joj1, repo, result, task |  | ||||||
| from joj3_config_generator.processers.task import ( | from joj3_config_generator.processers.task import ( | ||||||
|     fix_diff, |     fix_diff, | ||||||
|     fix_dummy, |     fix_dummy, | ||||||
|  | @ -18,7 +10,6 @@ from joj3_config_generator.processers.task import ( | ||||||
|     get_conf_stage, |     get_conf_stage, | ||||||
|     get_executorWithConfig, |     get_executorWithConfig, | ||||||
| ) | ) | ||||||
| from joj3_config_generator.models import joj1, repo, result, task |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config: | def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config: | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| import json | import json | ||||||
| import os | import os | ||||||
| from pathlib import Path | from pathlib import Path | ||||||
|  | from typing import Any, Dict | ||||||
| 
 | 
 | ||||||
| import inquirer | import inquirer | ||||||
| import rtoml | import rtoml | ||||||
|  | @ -9,8 +10,7 @@ import yaml | ||||||
| 
 | 
 | ||||||
| from joj3_config_generator.convert import convert as convert_conf | from joj3_config_generator.convert import convert as convert_conf | ||||||
| from joj3_config_generator.convert import convert_joj1 as convert_joj1_conf | from joj3_config_generator.convert import convert_joj1 as convert_joj1_conf | ||||||
| from joj3_config_generator.processers.task import remove_nulls | from joj3_config_generator.models import joj1, repo, task | ||||||
| from joj3_config_generator.models import joj1, repo, result, task |  | ||||||
| from joj3_config_generator.utils.logger import logger | from joj3_config_generator.utils.logger import logger | ||||||
| 
 | 
 | ||||||
| app = typer.Typer(add_completion=False) | app = typer.Typer(add_completion=False) | ||||||
|  | @ -47,8 +47,7 @@ def convert_joj1(yaml_file: typer.FileText, toml_file: typer.FileTextWrite) -> N | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @app.command() | @app.command() | ||||||
| def convert(root: Path = Path(".")) -> result.Config: | def convert(root: Path = Path(".")) -> Dict[str, Any]: | ||||||
| def convert(root: Path = Path(".")) -> result.Config: |  | ||||||
|     """ |     """ | ||||||
|     Convert given dir of JOJ3 toml config files to JOJ3 json config files |     Convert given dir of JOJ3 toml config files to JOJ3 json config files | ||||||
|     """ |     """ | ||||||
|  | @ -64,13 +63,10 @@ def convert(root: Path = Path(".")) -> result.Config: | ||||||
|     repo_obj = rtoml.loads(repo_toml) |     repo_obj = rtoml.loads(repo_toml) | ||||||
|     task_obj = rtoml.loads(task_toml) |     task_obj = rtoml.loads(task_toml) | ||||||
|     result_model = convert_conf(repo.Config(**repo_obj), task.Config(**task_obj)) |     result_model = convert_conf(repo.Config(**repo_obj), task.Config(**task_obj)) | ||||||
|     result_model = remove_nulls(result_model) |     result_dict = result_model.model_dump(by_alias=True, exclude_none=True) | ||||||
|     result_dict = result_model.model_dump(by_alias=True) |  | ||||||
| 
 | 
 | ||||||
|     with open(result_json_path, "w") as result_file: |     with open(result_json_path, "w") as result_file: | ||||||
|         json.dump(result_dict, result_file, ensure_ascii=False, indent=4) |         json.dump(result_dict, result_file, ensure_ascii=False, indent=4) | ||||||
|         result_file.write("\n") |         result_file.write("\n") | ||||||
| 
 | 
 | ||||||
|     return result_model |     return result_dict | ||||||
| 
 |  | ||||||
|     return result_model |  | ||||||
|  |  | ||||||
|  | @ -7,7 +7,9 @@ from joj3_config_generator.models import repo, result, task | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def getGradingRepoName() -> str: | def getGradingRepoName() -> str: | ||||||
|     host_name = socket.gethostname() |     # FIXME: uncomment back when everything is ready! | ||||||
|  |     host_name = "engr151" | ||||||
|  |     # host_name = socket.gethostname() | ||||||
|     return f"{host_name.split('-')[0]}-joj" |     return f"{host_name.split('-')[0]}-joj" | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,15 +4,6 @@ from typing import Tuple | ||||||
| from joj3_config_generator.models import result, task | from joj3_config_generator.models import result, task | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def remove_nulls(d: result.Config) -> result.Config: |  | ||||||
|     if isinstance(d, dict): |  | ||||||
|         return {k: remove_nulls(v) for k, v in d.items() if v is not None} |  | ||||||
|     elif isinstance(d, list): |  | ||||||
|         return [remove_nulls(item) for item in d] |  | ||||||
|     else: |  | ||||||
|         return d |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_conf_stage( | def get_conf_stage( | ||||||
|     task_stage: task.Stage, executor_with_config: result.ExecutorWith |     task_stage: task.Stage, executor_with_config: result.ExecutorWith | ||||||
| ) -> result.StageDetail: | ) -> result.StageDetail: | ||||||
|  |  | ||||||
|  | @ -27,34 +27,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4096, |                                 "max": 4096, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4096, |                                 "max": 4096, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -70,11 +58,7 @@ | ||||||
|                             "copyIn": { |                             "copyIn": { | ||||||
|                                 "./repo-health-checker": { |                                 "./repo-health-checker": { | ||||||
|                                     "src": "./repo-health-checker", |                                     "src": "./repo-health-checker", | ||||||
|                                     "content": null, |  | ||||||
|                                     "fileId": null, |  | ||||||
|                                     "name": null, |  | ||||||
|                                     "max": 4194304, |                                     "max": 4194304, | ||||||
|                                     "symlink": null, |  | ||||||
|                                     "streamIn": false, |                                     "streamIn": false, | ||||||
|                                     "streamOut": false, |                                     "streamOut": false, | ||||||
|                                     "pipe": false |                                     "pipe": false | ||||||
|  | @ -106,7 +90,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "Abuse of strings detected", |                 "name": "Abuse of strings detected", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -119,34 +102,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -162,11 +133,7 @@ | ||||||
|                             "copyIn": { |                             "copyIn": { | ||||||
|                                 "tools/strdetec": { |                                 "tools/strdetec": { | ||||||
|                                     "src": "/home/tt/.config/joj/tools/strdetec", |                                     "src": "/home/tt/.config/joj/tools/strdetec", | ||||||
|                                     "content": null, |  | ||||||
|                                     "fileId": null, |  | ||||||
|                                     "name": null, |  | ||||||
|                                     "max": 4194304, |                                     "max": 4194304, | ||||||
|                                     "symlink": null, |  | ||||||
|                                     "streamIn": false, |                                     "streamIn": false, | ||||||
|                                     "streamOut": false, |                                     "streamOut": false, | ||||||
|                                     "pipe": false |                                     "pipe": false | ||||||
|  | @ -201,7 +168,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "Compilation", |                 "name": "Compilation", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -213,34 +179,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -256,11 +210,7 @@ | ||||||
|                             "copyIn": { |                             "copyIn": { | ||||||
|                                 "tools/compile": { |                                 "tools/compile": { | ||||||
|                                     "src": "/home/tt/.config/joj/tools/compile", |                                     "src": "/home/tt/.config/joj/tools/compile", | ||||||
|                                     "content": null, |  | ||||||
|                                     "fileId": null, |  | ||||||
|                                     "name": null, |  | ||||||
|                                     "max": 4194304, |                                     "max": 4194304, | ||||||
|                                     "symlink": null, |  | ||||||
|                                     "streamIn": false, |                                     "streamIn": false, | ||||||
|                                     "streamOut": false, |                                     "streamOut": false, | ||||||
|                                     "pipe": false |                                     "pipe": false | ||||||
|  | @ -322,7 +272,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[cq] Filelength", |                 "name": "[cq] Filelength", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -338,34 +287,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -381,11 +318,7 @@ | ||||||
|                             "copyIn": { |                             "copyIn": { | ||||||
|                                 "tools/filelength": { |                                 "tools/filelength": { | ||||||
|                                     "src": "/home/tt/.config/joj/tools/filelength", |                                     "src": "/home/tt/.config/joj/tools/filelength", | ||||||
|                                     "content": null, |  | ||||||
|                                     "fileId": null, |  | ||||||
|                                     "name": null, |  | ||||||
|                                     "max": 4194304, |                                     "max": 4194304, | ||||||
|                                     "symlink": null, |  | ||||||
|                                     "streamIn": false, |                                     "streamIn": false, | ||||||
|                                     "streamOut": false, |                                     "streamOut": false, | ||||||
|                                     "pipe": false |                                     "pipe": false | ||||||
|  | @ -452,7 +385,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[cq] Clang-tidy", |                 "name": "[cq] Clang-tidy", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -469,34 +401,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 65000000000, |                                 "max": 65000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -512,11 +432,7 @@ | ||||||
|                             "copyIn": { |                             "copyIn": { | ||||||
|                                 "projects/p2/.clang-tidy": { |                                 "projects/p2/.clang-tidy": { | ||||||
|                                     "src": "/home/tt/.config/joj/projects/p2/.clang-tidy", |                                     "src": "/home/tt/.config/joj/projects/p2/.clang-tidy", | ||||||
|                                     "content": null, |  | ||||||
|                                     "fileId": null, |  | ||||||
|                                     "name": null, |  | ||||||
|                                     "max": 4194304, |                                     "max": 4194304, | ||||||
|                                     "symlink": null, |  | ||||||
|                                     "streamIn": false, |                                     "streamIn": false, | ||||||
|                                     "streamOut": false, |                                     "streamOut": false, | ||||||
|                                     "pipe": false |                                     "pipe": false | ||||||
|  | @ -609,7 +525,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[cq] Cppcheck", |                 "name": "[cq] Cppcheck", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -627,34 +542,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 65000000000, |                                 "max": 65000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -730,7 +633,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[cq] Cpplint", |                 "name": "[cq] Cpplint", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -747,34 +649,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 65000000000, |                                 "max": 65000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -856,7 +746,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[run] onecard", |                 "name": "[run] onecard", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -869,34 +758,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -950,7 +827,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[run] address sanitizer", |                 "name": "[run] address sanitizer", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -963,34 +839,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -1044,7 +908,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[run] memory sanitizer", |                 "name": "[run] memory sanitizer", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -1057,34 +920,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -1138,7 +989,6 @@ | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|                 "name": "[run] undefined behavior sanitizer", |                 "name": "[run] undefined behavior sanitizer", | ||||||
|                 "group": null, |  | ||||||
|                 "executor": { |                 "executor": { | ||||||
|                     "name": "sandbox", |                     "name": "sandbox", | ||||||
|                     "with": { |                     "with": { | ||||||
|  | @ -1151,34 +1001,22 @@ | ||||||
|                                 "PATH=/usr/bin:/bin:/usr/local/bin" |                                 "PATH=/usr/bin:/bin:/usr/local/bin" | ||||||
|                             ], |                             ], | ||||||
|                             "stdin": { |                             "stdin": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": "", |                                 "content": "", | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": null, |  | ||||||
|                                 "max": 4194304, |                                 "max": 4194304, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stdout": { |                             "stdout": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stdout", |                                 "name": "stdout", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|                             }, |                             }, | ||||||
|                             "stderr": { |                             "stderr": { | ||||||
|                                 "src": null, |  | ||||||
|                                 "content": null, |  | ||||||
|                                 "fileId": null, |  | ||||||
|                                 "name": "stderr", |                                 "name": "stderr", | ||||||
|                                 "max": 4000000000, |                                 "max": 4000000000, | ||||||
|                                 "symlink": null, |  | ||||||
|                                 "streamIn": false, |                                 "streamIn": false, | ||||||
|                                 "streamOut": false, |                                 "streamOut": false, | ||||||
|                                 "pipe": false |                                 "pipe": false | ||||||
|  | @ -1236,7 +1074,7 @@ | ||||||
|         "logPath": "p2-m3-joint-teapot-debug.log", |         "logPath": "p2-m3-joint-teapot-debug.log", | ||||||
|         "scoreboardPath": "p2-m3-scoreboard.csv", |         "scoreboardPath": "p2-m3-scoreboard.csv", | ||||||
|         "failedTablePath": "p2-m3-failed-table.md", |         "failedTablePath": "p2-m3-failed-table.md", | ||||||
|         "gradingRepoName": "Nuvole-joj", |         "gradingRepoName": "engr151-joj", | ||||||
|         "skipIssue": false, |         "skipIssue": false, | ||||||
|         "skipScoreboard": false, |         "skipScoreboard": false, | ||||||
|         "skipFailedTable": false |         "skipFailedTable": false | ||||||
|  |  | ||||||
|  | @ -3,6 +3,3 @@ from tests.convert.utils import load_case | ||||||
| 
 | 
 | ||||||
| def test_basic() -> None: | def test_basic() -> None: | ||||||
|     load_case("basic") |     load_case("basic") | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| test_basic() |  | ||||||
|  |  | ||||||
|  | @ -7,7 +7,6 @@ import rtoml | ||||||
| from joj3_config_generator.convert import convert | from joj3_config_generator.convert import convert | ||||||
| from joj3_config_generator.models import repo, task | from joj3_config_generator.models import repo, task | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| def read_convert_files( | def read_convert_files( | ||||||
|     case_name: str, |     case_name: str, | ||||||
| ) -> Tuple[repo.Config, task.Config, Dict[str, Any]]: | ) -> Tuple[repo.Config, task.Config, Dict[str, Any]]: | ||||||
|  | @ -28,6 +27,5 @@ def read_convert_files( | ||||||
| 
 | 
 | ||||||
| def load_case(case_name: str) -> None: | def load_case(case_name: str) -> None: | ||||||
|     repo, task, expected_result = read_convert_files(case_name) |     repo, task, expected_result = read_convert_files(case_name) | ||||||
|     result = convert(repo, task).model_dump(mode="json", by_alias=True) |     result = convert(repo, task).model_dump(mode="json", by_alias=True, exclude_none=True) | ||||||
| 
 |  | ||||||
|     assert result == expected_result |     assert result == expected_result | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user