Help us understand the problem. What is going on with this article?

CircleCIでLaravelのPHPUnitを実行した後のログをダウンロードできるようにする

CircleCIでLaravelのPHPUnitを実行した後のログをダウンロードできるようにする

表題にはLaravelのPHPUnitと書いているが、他のケースでも使えるテクニック。

CircleCIでPHPUnitを実行するのはすでに設定できている前提とする。

ログファイルが見えると、Featureテストで落ちた時などにエラー内容を確認できてとっても便利。

config.yaml編集

.circleci/config.yaml
(省略)
jobs:
  test: 
    docker:(省略)
    environment:(省略)
    working_directory: (省略)
    steps :
      - checkout
       (省略)
      # PHPUnit実行
      - run: php ./vendor/bin/phpunit -d memory_limit=512M  

      # 以下を追加する
+      - store_artifacts: 
+          path: ./storage/logs

CircleCIのテストの実行結果からログをダウンロードする

CircleCIでテストの実行結果画面を表示します。

スクリーンショット 2019-09-17 18.11.19.png

Artifactsタブでファイルをダウンロードできます。
(最近CircleCIのUIが新しくなったようです。)

参考

https://circleci.com/docs/2.0/artifacts/

以上

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away