Test metadata and caching

caching
artifacts

#1

Hello there!
I’m migrating a 1.0 conf to 2.0 and it seems circle is not correctly catching my junit.xml file. Or at least is not displaying its information…

1.0 correctly shows:

Your build ran 92 tests in unknown with 0 failures
Slowest test: should render create-campaign without props should render create-campaign without props (took 0.25 seconds).

2.0 does collect some artifacts but test summary is always empty:

Uploading /root/marketplace/artifacts to s3://circle-production-customer-artifacts/picard/[some-id-stuff]/artifacts/root/marketplace/artifacts
Uploaded /root/marketplace/artifacts/junit.xml

My config file:

version: 2
jobs:
  build:
    working_directory: ~/marketplace
    docker:
      - image: node:6

    steps:
      - checkout

      - restore_cache:
          key: yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}

      - run:
          name: Install Dependencies
          command: yarn

      - run:
          name: Lint
          command: yarn lint

      - run:
          name: Generate view tests
          command: yarn generate-view-tests

      - run:
          name: Test
          command: |
            NODE_ENV=test JEST_JUNIT_OUTPUT="artifacts/junit.xml" yarn jest -- -w 1 --testResultsProcessor jest-junit

      - save_cache:
          key: yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - "~/.yarn-cache"

      - store_artifacts:
          path: artifacts/
          path: ~/marketplace/artifacts

I also have another quick question about cache, I’m worried about that 32B size cache, is that information accurate? It should be lots of megabytes since this is about yarn cache files…

Found a cache from build 343 at yarn-circle2-5w51RZt3Dgw7GhUQGcNsnWNY7g6CcoaQMf_mUg3+qTU=
Size: 32 B
Cached paths:
  * /root/.yarn-cache

Downloading cache archive...
Unarchiving cache...

Thanks!


#2

Changing store_artifacts to store_test_results fixed it!


#3

And considering that a rebuild without cache took 20ish seconds more to install dependencies I’d guess it’s working fine.


#4

That is accurate. Can you try caching node_modules instead?

Great! :slight_smile:


#5

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