Cache and Test Results Directory Locations

I’m somewhat confused as to how the caches and test results are stored. I have the directories locally and they’re empty. What I don’t understand is where exactly are the test results and cache files saved? Obviously they aren’t saved locally or anything.

Do I need to move the test-results file over in my Dockerfile? I have it create the directory in my circleci config but i still see these messages:

Unable to save test results from /app/test-results
Error stat /app/test-results: no such file or directory
Found no path with test results, skipping

Uploading /app/test-results to app/test-results
  No artifact files found at /app/test-results

And my config:

version: 2
    working_directory: /app
      - image: bayesimpact/circleci
      - checkout
      - setup_remote_docker
      - restore_cache: # restores saved depdendency cache if Branch key template or requirements haven't changed
            - v1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
            - v1-{{ .Branch }}-dependencies        
      - run:
          name: Install dependencies
          command: |
            pip3 install virtualenv
            python3 -m venv venv
            . venv/bin/activate
            pip3 install --upgrade pip setuptools
            pip3 install -r requirements/test.txt
      - save_cache: # save dependency cache
          key: v1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
            - ./venv
      - restore_cache: # restore saved docker image cache if hasn't changed
            - v1-{{ .Branch }}
            - /caches/app.tar
      - run:
          name: Load Docker image layer cache
          command: |
            set +o pipefail
            docker load -i /caches/app.tar | true
      - run:
          name: Build application Docker image
          command: |
            docker build --cache-from=app -t app -f Dockerfile.test .
      - run:
          name: Save Docker image layer cache
          command: |
            mkdir -p /caches
            docker save -o /caches/app.tar app
      - save_cache: # save docker image cache
          key: v1-{{ .Branch }}-{{ epoch }}
            - /caches/app.tar
      - run:
          name: Build compose
          command: |
            docker-compose -f docker-compose.test.yml build
      - run:
          name: Run tests
          command: |
            docker-compose -f docker-compose.test.yml up
      - store_test_results:
          path: test-results
      - store_artifacts:
          path: test-results

I think I figured it out though. Now I’m just having trouble with the testing.

Would you add your config to this question? It’s hard (if not impossible) to work out what you are doing otherwise. :smile_cat:

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