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

submitの際のコマンド実行を追加 #234

Merged
merged 11 commits into from
Sep 28, 2021

Conversation

chaemon
Copy link
Contributor

@chaemon chaemon commented Jun 20, 2021

ACLなどでexpanderを実行してからsubmitできるようにしました。exec_before_submit, exec_after_submit, submit_filenameをconfigのsubmitで指定し、以下の機能があります。

  • 提出の前にexec_before_submitが実行される。ここにexpanderなどを指定。
  • 出力されたsubmit_filenameを提出
  • 提出後にexec_after_submitが実行される。生成されたsubmit_filenameを削除するなどの用途に使います

@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2021

Codecov Report

Merging #234 (16fe2d9) into stable (949428c) will increase coverage by 0.75%.
The diff coverage is 91.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           stable     #234      +/-   ##
==========================================
+ Coverage   89.73%   90.49%   +0.75%     
==========================================
  Files          62       63       +1     
  Lines        2612     2651      +39     
==========================================
+ Hits         2344     2399      +55     
+ Misses        268      252      -16     
Impacted Files Coverage Δ
atcodertools/tools/submit.py 83.33% <85.71%> (+29.48%) ⬆️
atcodertools/config/config.py 100.00% <100.00%> (ø)
atcodertools/config/submit_config.py 100.00% <100.00%> (ø)
atcodertools/release_management/version.py 100.00% <100.00%> (ø)
atcodertools/tools/tester.py 85.44% <100.00%> (-0.14%) ⬇️
atcodertools/client/models/contest.py 100.00% <0.00%> (+4.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2057e6e...16fe2d9. Read the comment docs.

if config.submit_config.exec_before_submit:
run_command(config.submit_config.exec_before_submit, "./")
if not config.submit_config.submit_filename:
print("submit_filename is not specified")
Copy link
Owner

@kyuridenamida kyuridenamida Jul 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他のコードみたいにprintではなくlogger使ってくれると統一性とか出力のコントロールが出来て出て嬉しいです。多分errorですかね

print("submit_filename is not specified")
return False
code_path = config.submit_config.submit_filename
print("changed to submitfile: ", code_path)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上です

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.info(f"Submit file path overriding happened. new submit file path: {code_path}")とかがいいかなと思います。

@kyuridenamida
Copy link
Owner

主にlog周りでコメントしました。
やっぱりテスト欲しいです。

  • exec_before_submit
  • submit_filename
  • exec_after_submit

このあたりが実際にconfigにある状態でsubmitを走らせたらちゃんと正しく動くかどうかのテストって追加できませんか?

@kyuridenamida
Copy link
Owner

よさそうです!!!!!!!!!!!!

@kyuridenamida kyuridenamida added this to the 2.10.0 milestone Sep 14, 2021
@kyuridenamida kyuridenamida merged commit da56d3b into kyuridenamida:stable Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants