Skip to content

Conversation

m-tmatma
Copy link
Member

appveyor でテストに失敗した場合でも artifacts を収集できるようにする実験

@m-tmatma
Copy link
Member Author

m-tmatma commented Nov 22, 2018

以下のコマンドを実行することにより、明示的にコマンドプロンプトから artifacts の
収集を行うことができる。

appveyor PushArtifact <file_name>

つまり、ビルドやテストに失敗しても好きなファイルを自由に artifacts の収集対象にすることができる。

参考サイト
https://help.appveyor.com/discussions/questions/1649-how-to-keep-a-build-artifact-when-tests-fail
https://www.appveyor.com/docs/packaging-artifacts/#pushing-artifacts-from-scripts

@m-tmatma
Copy link
Member Author

実際のビルドの実例
https://ci.appveyor.com/project/sakuraeditor/sandbox/builds/20491221

該当する処理のコード

sandbox/appveyor.yml

Lines 12 to 21 in 19429d7

build_script:
- cmd: >-
echo PLATFORM %PLATFORM%
echo CONFIGURATION %CONFIGURATION%
echo "test" > test.txt
appveyor PushArtifact test.txt

sandbox/appveyor.yml

Lines 26 to 30 in 19429d7

test_script:
- cmd: >-
echo "test_script 2"
exit /b 1

30行目で、テストを失敗させている。
20行目で appveyor PushArtifact を呼んでいる。

結果を見ると artifacts の収集ができている。

@m-tmatma m-tmatma changed the title appveyor でテストに失敗した場合でも artifacts を収集できるようにする実験 [WIP] appveyor でテストに失敗した場合でも artifacts を収集できるようにする実験 Nov 22, 2018
@m-tmatma m-tmatma marked this pull request as draft August 19, 2020 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant