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

add GitHub Actions for integration test #833

Merged
merged 6 commits into from
Dec 9, 2022

Conversation

fukusuket
Copy link
Collaborator

@fukusuket fukusuket commented Dec 9, 2022

hayabusa-sample-evtxに対して、ビルド後のhayabusaでコマンド実行をテストするworkflowを作成してみました!

すみません、このworkflowがmainマージ後にしか実行できないため、大変恐縮なのですが、
以下fukusuketリポジトリにて実行した内容で、もし差し支えなければマージいただけると幸いです🙇

What Changed

  • added GitHub Actions for Hayabusa integration test.
    • clone hayabusa-sample-evtx
    • run hayabusa commands
    • check that the return code of all commands is 0

How to use

  1. Go to GitHub Actions.
  2. click Integration Test in left menu.
  3. click Run worflow.
  4. choose branch you want to run test, then click Run workflow

スクリーンショット 2022-12-10 0 09 12

Integration test contents

Trigger

When I run the workflow manually.

OS

Run the tests on the following two OS in parallel.

  • ubuntu-20.04
  • windows-2019

Command

Run the following 13 commands, and if the return code is not 0, the workflow will fail.

  • help
  • update-rules -q
  • csv-timeline -d ../hayabusa-sample-evtx -o out.csv -q
  • csv-timeline -d ../hayabusa-sample-evtx -o out-s.csv -P super-verbose -q
  • json-timeline -d ../hayabusa-sample-evtx -o out.json -q
  • json-timeline -d ../hayabusa-sample-evtx -o out-s.json -P super-verbose -q
  • json-timeline -d ../hayabusa-sample-evtx -o out.jsonl -q -J
  • logon-summary -d ../hayabusa-sample-evtx -q
  • metrics -d ../hayabusa-sample-evtx -q
  • pivot-keywords-list -d ../hayabusa-sample-evtx -o p.csv -q
  • level-tuning --level-tuning ./rules/config/level_tuning.txt -q
  • set-default-profile -q
  • list-contributors -q

Execution time

It takes about 20 minutes to run all tests.(About 10 minutes build time ... :( )

Result

Failed

If the command results has one or more non-zero return codes.
スクリーンショット 2022-12-09 23 59 26

Succeded

If the return code is all 0 in the result of the commands.
スクリーンショット 2022-12-10 0 04 23

Note

Currently, I created test cases based on the specifications after subcommand implementation
(So currently running the workflow on the main branch will fail.)

@kazuminn
Copy link
Collaborator

kazuminn commented Dec 9, 2022

20分も待たないといけないのは、ちょっと辛いかな?と思いました。
現在何分かかるのかはわかりませんが、現在のCI時間との差異次第かなと思います。

@fukusuket
Copy link
Collaborator Author

@kazuminn
早速コメントありがとうございます🙇 そうですね20分が残念なところです><
こちらのテストですが、コミット毎実行ではなく、実行したいときに手動実行での用途(特定ブランチでリグレッションを確認したいときや、リリース前の成果物チェック)を想定しています!

@YamatoSecurity
Copy link
Collaborator

後でデフォルトで[profile.release]配下のcodegen-units = 1を消しましょうか?
正直、あまり速度は変わっていないようです。リリース時だけこちらでcodegen-units = 1に設定して、コンパイルしようと思います。

Copy link
Collaborator

@YamatoSecurity YamatoSecurity left a comment

Choose a reason for hiding this comment

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

LGTM.
一旦マージしましょう。

@fukusuket
Copy link
Collaborator Author

早速マージいただき、ありがとうございます🙇
ビルドオプションやOSなどすこし変えて試してみましたが、実行時間短縮につながるものが見つかりませんでした... ><

@YamatoSecurity YamatoSecurity merged commit bb4933a into main Dec 9, 2022
@hitenkoku hitenkoku deleted the feat-add-github-actions-for-integration-test branch December 9, 2022 23:50
@hitenkoku hitenkoku added the enhancement New feature or request label Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants