Git Product home page Git Product logo

cypress-circleci-reporter's People

Contributors

dependabot[bot] avatar ksocha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cypress-circleci-reporter's Issues

Running cypress multiple times

Hi there,

First of all, thanks for this reporter - sure makes life easier.

Just a quick question. We run cypress twice in our circleci job. The first time with:
--config 'viewportWidth=375,viewportHeight=667'

and then again with
--config 'viewportWidth=1024,viewportHeight=800'

the tests should not really change too much in timings, but will this setup cause problems with this reporter? E.g. should I keep the results of each run in a different directory so they dont conflict with one another?

Error: EEXIST: file already exists, mkdir '/home/circleci/cypress_tests/reports'

Hi,

I'm using this reporter with my CircleCI config and getting an error that is triggered by your line at

fs.mkdirSync(path.dirname(finalPath), { recursive: true });

I don't understand why it tries to create resultsDir, even when I provide it with a path, and when I do, it says it already exists, because it still tries to create it. As you can see, I have my steps for storing Cypress tests and no need a plugin to try and create more paths, I could make a PR, but not sure if forcing mkdir in your code has a purpose, so just raising an issue for now.

Example errors:

Nothing is provided as resultsDir:
here

Full path provided:
here

My config:

version: 2.1

aliases:
  - &persist_to_workspace
    persist_to_workspace:
      root: /home/circleci/join-test
      paths: ["cypress_tests"]
  - &attach_workspace
    attach_workspace:
      at: /home/circleci/join-test
  
executors:
  browsers:
    docker:
      - image: circleci/node:12.6-browsers
    working_directory: /home/circleci/join-test
      
commands:
  auth_cypress_with_registry:
    steps:
      - run:
          name: Authenticate with registry
          command: cd cypress_tests && echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > .npmrc
  npm_ci:
    steps:
      - run:
          name: Install dependencies (npm ci)
          command: cd cypress_tests && npm ci
  save_cypress_cache:
    steps:
      - save_cache:
          key: dep2-{{ .Branch }}-cache-{{ checksum "cypress_tests/package-lock.json" }}
          paths:
            - ~/.npm
            - ~/.cache/Cypress
  restore_cypress_cache:
    steps:
      - restore_cache:
          key: dep2-{{ .Branch }}-cache-{{ checksum "cypress_tests/package-lock.json" }}
  run_cypress_all:
    steps:
      - restore_cypress_cache
      - run:
          name: Run all cypress tests in parallel
          no_output_timeout: 5m
          command: |
            cd cypress_tests && npx cypress run --spec "$(circleci tests glob "./cypress/integration/**/*.feature" | circleci tests split --split-by=timings --timings-type=filename | paste -sd "," -)" --reporter cypress-circleci-reporter --reporter-options resultsDir=results resultsFileName=cypress-$CIRCLE_BUILD_NUM
  store_cypress_test_results:
    steps:
      - store_test_results:
          path: cypress_tests/reports
      - store_artifacts:
          path: cypress_tests/reports
          destination: cypress/reports
      - store_artifacts:
          path: cypress_tests/cypress/videos
          destination: cypress/videos
      - store_artifacts:
          path: cypress_tests/cypress/screenshots
          destination: cypress/screenshots
   
jobs:
  build_cypress:
    executor: browsers
    steps:
      - checkout
      - restore_cypress_cache
      - auth_cypress_with_registry
      - npm_ci
      - run:
          name: cypress install
          command: cd cypress_tests && npx cypress install
      - save_cypress_cache
      - *persist_to_workspace
  pr_all:
    executor: browsers
    parallelism: 20
    steps:
      - *attach_workspace
      - run_cypress_all
      - store_cypress_test_results
  lint:
    working_directory: /home/circleci/join-test
    docker:
      - image: circleci/node:12.6
    steps:
      - checkout
      - restore_cypress_cache
      - auth_cypress_with_registry
      - npm_ci
      - run:
          name: lint cypress
          command: cd cypress_tests && npm run lint
      - run:
          name: check types cypress
          command: cd cypress_tests && npm run ts:check
      - run:
          name: lint tags
          command: cd cypress_tests && node scripts/validate_tags.js
          
workflows:
  version: 2
  build_test:
    jobs:
      - lint
      - build_cypress
      - pr_all:
          requires:
            - build_cypress

Filename always reported as ""

Hi!
I cannot figure out if I'm just missing some configuration or if I've encountered a bug.
I've added the reporter to my Cypress command on CircleCI and it is generating .xml-files in the test results folder.

However the report files are not including the file name of the spec, instead "file" is just empty.
Example below:

# test_results/cypress/cypress-5e9a03c5479c2136b2f0f8b114050eb8.xml
<testsuite name="cypress" timestamp="2020-11-02T13:14:06" time="11.3070" tests="4" failures="0" skipped="0">
    ...
    <testcase name="guest cannot see assignments" file="" time="0.8800" classname="Learning > Assignments.signed out"/>
    ...
</testsuite>

This leads CircleCI to output the following on the next run:

...
Autodetect no matching filename or classname.  If file names are used, double check paths for absolute vs relative.
Example input file: "cypress/integration/admin/course_versions_spec.js"
Example file from timings: ""

I tried switching to --timings-type=classname for circleci tests split but that didn't work either since the classnames stated in the reports file are not really class names.

Is this something you've encountered before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.