Flask持续集成错误30 python

问题描述 投票:0回答:1

我正在尝试执行持续集成,但不断得到:

错误:进程已完成,退出代码为 30。

    enter code************* Module test_routes
test/test_routes.py:46:0: C0301: Line too long (115/100) (line-too-long)
test/test_routes.py:157:0: C0301: Line too long (115/100) (line-too-long)
test/test_routes.py:191:0: C0301: Line too long (103/100) (line-too-long)
test/test_routes.py:1:0: R0401: Cyclic import (seoulbike_app -> seoulbike_app.contact_bp) (cyclic-import)
test/test_routes.py:1:0: R0401: Cyclic import (seoulbike_app -> seoulbike_app.bike_bp) (cyclic-import)
test/test_routes.py:1:0: R0401: Cyclic import (seoulbike_app -> seoulbike_app.blog_bp) (cyclic-import)
test/test_routes.py:1:0: R0401: Cyclic import (seoulbike_app -> seoulbike_app.contact_bp -> seoulbike_app.models) (cyclic-import)

-----------------------------------
Your code has been rated at 8.24/10

Error: Process completed with exit code 30. here

这是错误的最后几部分,我在日志中找不到任何有用的信息。

我的 Flask 应用程序的 CI 管道的代码是:

name: Flask app test

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        python-version: ["3.9"]

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

    - name: Lint with flake8
      run: |
        pip install flake8
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --verbose --exit-zero

    - name: Set up Flask configuration
      run: |
        export FLASK_APP=seoulbike_app.py
        export FLASK_ENV=testing

    - name: Run tests with pytest and coverage
      run: |
        python -m pip install pytest pytest-cov
        python -m pytest tests/ --verbose --cov=seoulbike_app --ignore-errors

顺便说一下,pytest 在 pycharm 中运行良好。

flask continuous-integration
1个回答
0
投票

您必须忽略 github 操作中的退出代码

|| true

https://www.geeksforgeeks.org/understanding-and-ignoring-errors-in-bash/

© www.soinside.com 2019 - 2024. All rights reserved.