(一) 关于配置travis-ci持续集成python pytest测试的相关记录
首先由于公司用上了高大上的travis-ci商用版,一直想試著學學弄弄看。現在要寫openapi的相關測試,而且要在travis-ci上集成。我就想體驗一下這個過程。所以自己弄了一個public的倉庫先嘗試一下。
?
首先了解travis-ci的相關比較重要。https://docs.travis-ci.com/user/customizing-the-build/
這里首先介紹了需要集成測試的語言指定方面的問題。travis-ci的所有配置都集中在一個叫做?.travis.yml 的文件下面。這個文件告訴travis-ci
- What programming language your project uses
- What commands or scripts you want to be executed before each build (for example, to install or clone your project’s dependencies)
- What command is used to run your test suite
- Emails, Campfire and IRC rooms to notify about build failures
所以可以看出,相關的自定義處理都在這個文件里面進行寫入。下面我繼續翻譯一下文檔。
創建travis-ci一般由兩步構成:
1. 安裝:安裝依賴和需求
2. 腳本:運行編寫的腳本文件
你可以執行自定義命令在安裝之前before_install或者在運行腳本之前before_script或者在運行腳本之后after_script.
在before_install里,你可以安裝一些額外的需求比如說ubuntu包和一些自定義的服務。
下面太簡單懶得翻了直接貼
You can perform additional steps when your build succeeds or fails using the?after_success?(such as building documentation, or deploying to a custom server) or?after_failure?(such as uploading log files) options. In both?after_failure?and?after_success, you can access the build result using the?$TRAVIS_TEST_RESULT?environment variable.
The complete build lifecycle, including three optional deployment steps and after checking out the git repository and changing to the repository directory, is:
如果步需要第一步安裝的話 可以直接設置 install: true
?
轉載于:https://www.cnblogs.com/piperck/p/5111849.html
總結
以上是生活随笔為你收集整理的(一) 关于配置travis-ci持续集成python pytest测试的相关记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 跟我一起写 Makefile(十三)
- 下一篇: Win7_Wifi热点