Artifacts, Test Results not working in CircleCI 2.0

circle.yml
config

#1

I have tried a bunch of different configurations but I just can’t seem to get it to work with the help of tutorials, existing configurations on other projects and with the documentation at hand.

It. Does. Not. Work.

I tried storing test results as an artifact and as a test result. As well as both.

It it actually broken or am I missing some knowledge here?

I’m using paths like ./artifacts or /artifacts artifacts or ~/artifacts. Nothing works.

Have a look at this build:

https://circleci.com/gh/PerfectionCSGO/perfection-tv/38#config/containers/0

.yml below:

# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/node:9.5.0
      
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      # install project!
      - run: yarn install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
        
      # run tests!
      - run: yarn test

      # dist!
      - run: yarn dist
      
    store_artifacts:
      path: dist
    store_test_results:
      path: artifacts/test-results

Edit: I fixed it and I’m editing my post since I can’t post a reply.

I was missing dashes at the bottom of the script and missing indenting for it as well.


#2
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/node:9.5.0
      
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      # install project!
      - run: yarn install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
        
      # run tests!
      - run: yarn test

      # dist!
      - run: yarn dist

      # store dist
      - store_artifacts:
          path: dist

      # store dist
      - store_artifacts:
          path: artifacts/coverage

      # store dist
      - store_artifacts:
          path: artifacts/test-results

     # store test results
      - store_test_results:
          path: artifacts/test-results

#3

So. It. Does. Work. Then?

:smiling_imp:


#4

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.