我正在尝试使用 docker-compose 文件运行邮递员 json 集合。它使用 newman html extra 来生成 html 报告。然后我试图上传这个工件。在 Postman 运行期间,我看到一个日志条目:“postmanTests | Created the htmlextra report”。但是,在上传步骤中,我看到一条警告:“警告:未找到具有提供的路径的文件:testResults。不会上传任何工件。”
YML 文件:
name: PostmanTestsWorkflow
on:
pull_request:
push:
branches:
- main
jobs:
Run_Postman_Scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Make Directory for results
run: mkdir -p testResults
- name: Postman Scripts Run
id: run-newman
run: docker-compose up
- name: Output the run Details
uses: actions/upload-artifact@v2.2.4
with:
name: RunReports
path: testResults
- name: Output summary to console
run: echo ${{ steps.run-newman.outputs.summary }}
码头工人-compose.yml
version: '3.9'
networks:
quick_app:
name: quicknetwork
driver: bridge
services:
postman:
container_name: postmanTests
build:
context: ./QuickRestaurant.QA.Tests/postman
dockerfile: Dockerfile
image: quickrestaurant_postman_tests
command:
run DummyPostmanCollection.json -r htmlextra --reporter-htmlextra-export "testResults/htmlreport.html"
volumes:
- ./QuickRestaurant.QA.Tests/postman:/etc/newman
networks:
- quick_app
volumes:
local_admindb_volume: {}
local_coredb_volume: {}
在使用 docker-compose up 在本地运行时,我可以看到报告是由 Newman 生成的。