Clean up test runner: convert languages.json to Python, consolidate proto files - #75
Conversation
…mbine proto files Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
…dMessage exclusion Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
There was a problem hiding this comment.
This PR should refactor this further.
Create a python language base class that has the functions compiler check, interpreter check, and runner check. Then also a compile, interpret, and run functions that take arguments.
This file should be less of a config that is passed and more of boilerplate code that will actually do actions for each language.
There was a problem hiding this comment.
Refactored languages.py with a Language base class that includes action methods:
check_compiler()/check_interpreter()/check_tools()- Tool availability checkingcompile()/compile_project()- Compilation actionsrun()/run_project()/get_env()- Execution actions
Each language (C, C++, Python, TypeScript, JavaScript, GraphQL, C#) is now a subclass with its own implementation. The to_dict() method provides backward compatibility with existing runner code.
There was a problem hiding this comment.
In this PR remove to_dict() and modify the runner code to use the new language classes.
There was a problem hiding this comment.
Removed to_dict() and refactored all runner code to use Language instances directly. The runner now accesses Language properties directly (e.g., lang.name, lang.compiler, lang.get_build_dir()) instead of through dictionary lookups.
Key changes:
runner/base.py: Addedget_lang()method to get Language instancesrunner/tool_checker.py: Uses Language'scheck_tools()methodrunner/compiler.py: Uses Language'scompile()andcompile_project()methodsrunner/plugins.py: Uses Language instances viaexecutor.get_lang()- All other runner modules updated similarly
See commit bf10538.
There was a problem hiding this comment.
Done in commit bf10538. The to_dict() method has been removed and all runner code now uses Language instances directly.
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
…used ABC import Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
There was a problem hiding this comment.
In this PR remove to_dict() and modify the runner code to use the new language classes.
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
languages.jsontolanguages.pywith direct Python callsbase_languageandlanguages_filefields fromtest_config.jsontest_messages.protofilecheck_compiler()/check_interpreter()/check_tools()- Tool availability checkingcompile()/compile_project()- Compilation actionsrun()/run_project()/get_env()- Execution actionsto_dict()and updated runner code to use Language instances directly (per review feedback):to_dict()method from Language classget_languages_dict()functionrunner/base.pyto useget_lang()method to get Language instancesrunner/tool_checker.pyto use Language'scheck_tools()methodrunner/compiler.pyto use Language'scompile()andcompile_project()methodsrunner/code_generator.pyto access Language properties directlyrunner/output_formatter.pyto use Language instancesrunner/test_executor.pyto use Language instancesrunner/runner.pyto use Language instancesrunner/plugins.pyto use Language instances viaexecutor.get_lang()run_tests.pyclean_test_files to use Language instancesOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.