Customized Auto-DevOps not using Dockerfile for testing

Since Dajngo/Python tests don’t work with Python buidlpacks, I’ve copied .gitlab-ci.yml Atuo-DevOps template file to my project and edited tests. I’m using custom Dockerfile in my project, which installs dependencies (pip, pipenv, etc.), however, when test stage is triggered, tests fail because "pipenv: command not found". This is how I configured my test stage (i.e. how I overridden default auto-devops template):

test:
  services:
    - postgres:latest
  variables:
    POSTGRES_DB: test
  stage: test
  image: docker:stable
  services:
    - docker:stable-dind
  script:
    - setup_docker
    - setup_test_db
    - pipenv install --dev
    - pipenv run python manage.py test
 only:
    - branches
  except:
    variables:
      - $TEST_DISABLED

Why is my Dockerimage not used during tests? It was successfully built during the build stage. How do I configure my tests to use Dockerfile from my repo? Is that possible without uploading it to docker hub?

Auto-DevOps uses different Docker images for testing and deployment. Which is kinda odd, but my problem was resolved by changing the image in the test stage.

1 Like