Skip to main content

lunar_test

Project description

【lunar-Ci】今日诸事不宜!

你是否有过这样的经历,明明合并代码之前通过了所有测试,但是上线之后服务就炸了?

这是因为你的测试不够全面。在Librian幼女娱乐中心(这是个公司),合并代码之前得先检查黄历,如果黄历说诸事不宜,那就不能合并。

使用方法

你只需要为你的GitHub仓库新建一个Action,设置为在收到PR的时候进行单元测试就可以了。

之后所有的PR提交的时候,就会自动对黄历进行测试,从而阻止仓库维护者在诸事不宜的那天合并代码。

Action的参考代码长这样——

name: CI
on:
  push:
    branches: [ slave ]
  pull_request:
    branches: [ slave ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2.2.2
        with:
          python-version: 3.9
      - name: Install dependencies
        run: pip install lunar_test
      - name: lunar_test
        run: python -m unittest lunar_test

对了,虽然这是一个Python仓库,但这个Action和仓库语言没有关系,大家都可以用。

本地测试

你也可以使用lunar_test来测试你的本地代码,也只要先pip install lunar_test,然后在测试脚本里加上——

python -m unittest lunar_test

这样就好了,测试代码从来没有这么方便!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lunar_test-0.0.5.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lunar_test-0.0.5-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file lunar_test-0.0.5.tar.gz.

File metadata

  • Download URL: lunar_test-0.0.5.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for lunar_test-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5cf6d4b0b451925181b4a8bf8b5273e454a302e0ca31831de9fe7925dc1c9c21
MD5 76489c4a541ad9fa49825a957db79689
BLAKE2b-256 308da7eb3383b4e64b21b71c62e6efcc22e692a51b0f529dd5335d12dac6eb73

See more details on using hashes here.

File details

Details for the file lunar_test-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: lunar_test-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for lunar_test-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5a8a4ad71c7f4bd2052a764bc20127d02932f01e63aa526e0a05c9d1b799bdeb
MD5 9f804f9a079d5889f32ffc878f2aff12
BLAKE2b-256 ca0df1f91ef1d507488d88c44af7c259e97d4d4b2eff8c0b801af9b85bd25738

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page