日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

(一) 关于配置travis-ci持续集成python pytest测试的相关记录

發布時間:2025/7/25 68 豆豆
生活随笔 收集整理的這篇文章主要介紹了 (一) 关于配置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:

  • before_install
  • install
  • before_script
  • script
  • after_success?or?after_failure
  • OPTIONAL?before_deploy
  • OPTIONAL?deploy
  • OPTIONAL?after_deploy
  • after_script
  • 如果步需要第一步安裝的話 可以直接設置 install: true

    ?

    轉載于:https://www.cnblogs.com/piperck/p/5111849.html

    總結

    以上是生活随笔為你收集整理的(一) 关于配置travis-ci持续集成python pytest测试的相关记录的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。