0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Circle Ciで、pythonのunittestを実行する。pyramidプロジェクト

Posted at

slackと連携する

以下のxxxを自分のSlackの名前に変更してアクセス

Circle Ciを検索して追加する
この画面に表示されるWebhookURLをコピーしておく

Circle Ciにログインする
Add Projectで連携したいプロジェクトを選択する
歯車マークをクリックして
 2019-06-09 15.34.55.png
Chat Notificationsから、Slackを選択してコピーしておいたWebhookURLを入れて保存する

実装する

pyramidのサンプル用のプロジェクトを作成する
こちらを参考にしてください
https://qiita.com/noracorn92/items/07f5f7dbad8f551c3c45

miniappというプロジェクト名で作成しました

cd miniapp
pip freeze > requirements.txt
vi requirements.txt

requirements.txtを編集して、git clone している部分を削除します

Circle Ciで使用する設定ファイルを作成する

mkdir .circleci
cd .circleci
vi config.yml
config.yml
version: 2
jobs:
  build:
    docker:
      - image: python:3

    steps:
      - checkout
      - run: apt-get update && apt-get install -y libgmp3-dev
      - run:
          name: Install dependencies
          command: pip install -r requirements.txt
      - run:
          name: setup miniapp
          command: pip install -e .
      - run:
          name: Run tests
          command: cd miniapp/pages/tests;python -m unittest

※ miniapp/pages/testsにテストケースがあるとします。

結果を確認する

masterにプッシュした時点で、テストが走ります。
CircleCI.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?