How to set Allure report in CodeFresh

0

I created a cloud storage AWS S3 and connected to CodeFresh. Then as i following the instruction from allure documentation codefresh needs to look for allure-results but i dont know where is this folder and how to connect to it. I find a plugin and it looks like this enter code here upload_report: title: Upload Allure Report type: test-reporting fail_fast: false arguments: allure_dir: /codefresh/volume/e2e_api_test/allure-report bucket_name: amazon storage_integration: minios branch: master

when im running regression its not showing me test result button, so should i create folder inside git or whats the steps?

Hello and welcome to the Codefresh community

As explained in the documentation, the allure-resuts folder should be created after running Allure itself. See Test reports · Codefresh | Docs

How do you run Allure in your pipeline? Could you post here the YAML of your pipeline please?

Hi! Thank you! Im pretty new in codefresh, as i get it i go to pipeline workflow and there is inline yaml
here is at the bottom

More examples of Codefresh YAML can be found at

CI/CD pipeline Examples · Codefresh | Docs

version: “1.0”

Stages can help you organize your steps in stages

stages:

  • “clone”
  • “build”
  • “test”

steps:
clone:
title: “Cloning repository”
type: “git-clone”
repo: “qalesson/flatlay7”
# CF_BRANCH value is auto set when pipeline is triggered
# Learn more at Variables · Codefresh | Docs
revision: “${{CF_BRANCH}}”
git: “github-1”
stage: “clone”

build:
title: “Building Docker image”
type: “build”
image_name: “qalesson/flatlay7”
working_directory: “${{clone}}”
tag: “${{CF_BRANCH_TAG_NORMALIZED}}”
dockerfile: “Dockerfile”
stage: “build”

test:
title: “Running test”
type: “freestyle” # Run any command
image: ${{build}}
working_directory: “${{clone}}” # Running command where code cloned
volumes:
- /dev/shm:/dev/shm
commands:
- “npm i”
- “npm test”
- cp -r -f ./allure-results $CF_VOLUME_PATH/allure-results
stage: “test”

upload_report:
  title: Upload Allure Report
  type: test-reporting
  fail_fast: false
  arguments:
    allure_dir: /codefresh/volume/e2e_api_test/allure-report
    bucket_name: amazon
    storage_integration: minios
    branch: master
    
unit_test_reporting_step:
       title: Generate test reporting
       image: codefresh/cf-docker-test-reporting
       working_directory: '${{CF_VOLUME_PATH}}/'
       environment:
         - BUCKET_NAME=dct-user-data-lab111111
         - CF_STORAGE_INTEGRATION=amazon

Hi

I assume that your repository is at https://github.com/qalesson/flatlay7. Is that correct?

I cannot find any allure integration on it. Have you set it up according to the docs? Mocha

I mean, if you forget Codefresh for a moment, if you run locally the tests on your workstation, is the allure-results folder created correctly?

yep, forget to merge pr, just did it, when running locally allure-reports folder created. still cant see it in codefresh, im gettin some error rn : Failed to run freestyle step: Running test

Caused by Container for step title: Running test, step type: freestyle, operation: Freestyle step. Failed
with exit code: 1

maybe im doing something wrong, what should i do next after setting allure in framework ?

Can you post the URL of the build that has the error?

It should be something like https://g.codefresh.io/build/61823374b28e9c80bcff

https://g.codefresh.io/build/61819bf6cc4eff9099831136

Thank you.

You also need to enable this checkbox in your account for me to see the build https://codefresh.io/docs/docs/administration/user-settings/#enable-access-for-support-personnel

By default your pipelines are not accessible to anybody (not even Codefresh personnel).

Just did it! Codefresh | console

Hello

I checked your pipeline

Spec Files:      4 passed, 8 failed, 12 total (100% completed) in 00:03:29                                                              
                                                                                                                                        
npm ERR! Test failed.  See above for more details.   

Your unit tests have failed. And therefore the whole pipeline has stopped.
You have two choices:

  1. Either fix the tests
  2. Or make the pipeline continue even when there are failed tests as explained here with fail_fast property Test reports · Codefresh | Docs

Also looking at your pipeline.

  1. The test, upload_report and unit_test_reporting_step don’t have the same indentation level
  2. You only need the upload_report OR the unit_test_reporting_step. They both do the same thing (it is the old and the new syntax)

All details should be here Test reports · Codefresh | Docs

I added fail_fast property and delete upload_report, still error

do i need to have allure-report folder in git repo? or its gonna get created by codefresh somewhere?
also maybe problem in path :
unit_test_reporting_step:
title: Generate test reporting
image: codefresh/cf-docker-test-reporting
working_directory: ‘${{CF_VOLUME_PATH}}/’
environment:
- BUCKET_NAME=dct-user-data-lab111111
- CF_STORAGE_INTEGRATION=amazon

did i write it correctly? bucket name the one from s3 aws storage? is there any requirements for this storage? private bucket or not?

Hello again

As far as I know the folder allure-report is created by Allure itself. Codefresh only searches for this folder and presents the results in a nice format

I don’t think the S3 bucket needs special requirements. As long as Codefresh can access it (from the integration screen) it should work.

I have looped in our support team, so they will soon contact you and guide you with the errors.

thanks! where they gonna reach me?