# Storing artifacts and test results issue

**URL:** <https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172>\
**Category:** Running Tests\
**Tags:** 2.0, circle-yml, docker, django\
**Created:** [September 16, 2018, 5:57pm UTC](https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172 "2018-09-16T17:57:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xshenk](https://avatars.discourse-cdn.com/v4/letter/0/c67d28/32.png) [@0xshenk](https://discuss.circleci.com/u/0xshenk)\
**Post date:** [September 16, 2018, 5:57pm UTC](https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172/1 "2018-09-16T17:57:31Z")

</div>

So in my circle.yml I call mkdir -p test-results/coverage test-results/nose

But when it gets to the step to store artifacts or test results, it can’t find the directory. The workaround I found was to create the directories and transfer them into my image in the Dockerfile with .gitkeep files in them so they will be added to source control.

This seems incorrect, why would it not be able to find the directories when I create them with mkdir? They’re on the same directory as the app and my config for nose and coverage are as follows:

In my settings.py:

```
NOSE_ARGS = [
    '--with-coverage',
    '--cover-package=sasite',
    '--with-xunit',
    '--xunit-file=test-results/nose/noseresults.xml',
    '--verbosity=3'
]

```

and my coverage setup:

```
if settings.IS_TESTING:
    import coverage
    cov = coverage.coverage(source=['sasite'], omit=['*/tests/', '/logs/', '/test-results/*', '*/test-results/*', '*/*/locale/*', '*/locale/*', '*/migrations/*', '/my.conf/*', '/env1/*', '/venv/*', '/caches/*', '/.docker/*', '/.circleci/*', '/scripts/*'])
    cov.set_option('report:show_missing', True)
    cov.erase()
    cov.start()

execute_from_command_line(sys.argv)

if settings.IS_TESTING:
    cov.stop()
    cov.save()
    cov.html_report(directory='test-results/coverage/coveragehtml.html')
    cov.xml_report(outfile='test-results/coverage/coveragexml.xml')
    cov.report()

```

When I create the directory for test-results with .gitkeep locally, it does succeed in saving artifacts and test results, or so it says. But nothing shows up in the summary.

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [September 16, 2018, 6:27pm UTC](https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172/2 "2018-09-16T18:27:41Z")

</div>

Can you share your `circle.yml` file (and a link to a build?)

---

<div class="post-metadata">

**Author:** ![0xshenk](https://avatars.discourse-cdn.com/v4/letter/0/c67d28/32.png) [@0xshenk](https://discuss.circleci.com/u/0xshenk)\
**Post date:** [September 16, 2018, 8:15pm UTC](https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172/3 "2018-09-16T20:15:12Z")

</div>

A link to the build:

[https://circleci.com/bb/shenkan-associates/sawebsite-redesign/145](https://circleci.com/bb/shenkan-associates/sawebsite-redesign/145)

But I’m not sure you can see it since it’s a private organization. The build doesn’t show anything anyway, here’s the output for the save test results and store artifacts steps:

```
Uploading artifacts00:00
Uploading /app/test-results to test
Uploading /app/test-results/coverage/.gitkeep: SKIPPED, file is empty
Uploading /app/test-results/nose/.gitkeep: SKIPPED, file is empty
Uploading test results00:00

```

As you can see, the .gitkeep files are in the directories because mkdir doesn’t seem to work to create them. I had to add them to source control and put .gitkeep files in to get them to show up otherwise it tells me it can’t find the directories. Even when I have the command mkdir -p test-results/coverage test-results/nose above these steps.

```
Archiving the following test results
  * /app/test-results

```

Here’s my config.yml:

```
version: 2
jobs:
  build:
    working_directory: /app
    docker:
      - image: bayesimpact/circleci
    steps:
      - checkout
      - setup_remote_docker
      - restore_cache:
          keys: 
            - 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:
          key: v1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
          paths:
            - ./venv
      - restore_cache:
          keys:
            - v1-{{ .Branch }}
          paths:
            - /caches/app.tar
      - run:
          name: Load Docker image layer cache
          command: |
            set +o pipefail
            docker load -i /caches/app.tar | true
      - run:
          name: Build and tag application Docker image
          command: |
            docker build --cache-from=/caches/app -t app -f Dockerfile.imagetest .
            docker tag app app:testing
      - run:
          name: Save Docker image layer cache
          command: |
            mkdir -p caches
            docker save -o /caches/app.tar app
      - save_cache:
          key: v1-{{ .Branch }}-{{ epoch }}
          paths:
            - /caches/app.tar            
      - run:
          name: Run tests
          command: |
            . venv/bin/activate
            docker run app:testing
# - run:
# name: Build docker compose
# command: |
# docker-compose -f docker-compose.test.yml up -d --build
# - run:
# name: Run docker compose tests
# command: |
# docker-compose -f docker-compose.test.yml up
      - store_artifacts:
          path: test-results/coverage
          destination: coverage
      - store_artifacts:
          path: test-results/nose
          destination: test
      - store_test_results:
          path: test-results/nose
          destination: test
```

---

<div class="post-metadata">

**Author:** ![Cormac](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/cormac/32/18955_2.png) [@Cormac](https://discuss.circleci.com/u/Cormac)\
**Post date:** [September 18, 2018, 12:53am UTC](https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172/4 "2018-09-18T00:53:08Z")

</div>

It looks like nothing is in those folders to be saved:

```auto
Uploading /app/test-results to tr1
Uploading /app/test-results/coverage/.gitkeep: SKIPPED, file is empty
Uploading /app/test-results/nose/.gitkeep: SKIPPED, file is empty

```

The only files it’s finding are the .gitkeep files – are the files being saved by the test-runner there to be uploaded? Could you try logging in with SSH and running a `find` command to verify where the files are being saved?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [December 17, 2018, 1:05am UTC](https://discuss.circleci.com/t/storing-artifacts-and-test-results-issue/25172/5 "2018-12-17T01:05:14Z")

</div>

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