代码之家  ›  专栏  ›  技术社区  ›  UnicornsOnLSD

检查gitlab ci中给定的输出是否正确

  •  0
  • UnicornsOnLSD  · 技术社区  · 6 年前

    我已经切换到gitlab并使用它们的ci函数。是否可以检查程序输出是否正确?

    例如,如果我将下面的.py放入ci中,是否可以检查输出是否为“hello world”?

    print("Hello World")
    

    如果ci检测到程序没有打印“hello world”,是否可能使测试失败?

    谢谢)

    1 回复  |  直到 6 年前
        1
  •  0
  •   Mr.Pisos    6 年前

    试试这个:

    script:
      - if ! [[ $(./test.py) == 'Hello World' ]]; then exit 1; fi