(一) 关于配置travis-ci持续集成python pytest测试的相关记录
首先由于公司用上了高大上的travis-ci商用版,一直想試著學(xué)學(xué)弄弄看。現(xiàn)在要寫openapi的相關(guān)測(cè)試,而且要在travis-ci上集成。我就想體驗(yàn)一下這個(gè)過(guò)程。所以自己弄了一個(gè)public的倉(cāng)庫(kù)先嘗試一下。
?
首先了解travis-ci的相關(guān)比較重要。https://docs.travis-ci.com/user/customizing-the-build/
這里首先介紹了需要集成測(cè)試的語(yǔ)言指定方面的問(wèn)題。travis-ci的所有配置都集中在一個(gè)叫做?.travis.yml 的文件下面。這個(gè)文件告訴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
所以可以看出,相關(guān)的自定義處理都在這個(gè)文件里面進(jìn)行寫入。下面我繼續(xù)翻譯一下文檔。
創(chuàng)建travis-ci一般由兩步構(gòu)成:
1. 安裝:安裝依賴和需求
2. 腳本:運(yùn)行編寫的腳本文件
你可以執(zhí)行自定義命令在安裝之前before_install或者在運(yùn)行腳本之前before_script或者在運(yùn)行腳本之后after_script.
在before_install里,你可以安裝一些額外的需求比如說(shuō)ubuntu包和一些自定義的服務(wù)。
下面太簡(jiǎn)單懶得翻了直接貼
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:
如果步需要第一步安裝的話 可以直接設(shè)置 install: true
?
轉(zhuǎn)載于:https://www.cnblogs.com/piperck/p/5111849.html
總結(jié)
以上是生活随笔為你收集整理的(一) 关于配置travis-ci持续集成python pytest测试的相关记录的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 跟我一起写 Makefile(十三)
- 下一篇: Win7_Wifi热点