Sign inSign up

databricksdocs/pytest

By databricksdocs

Updated about 3 years ago

Contains pytest and required libraries

Image
1

100K+

databricksdocs/pytest repository overview

pytest

This folder contains a Dockerfile and other configs required to build the pytest container that runs the CircleCI job for the testing suite.

Usage

All of the examples given here assume the current working directory is the root of the docs repository.

Make sure you reference the correct version of the feature store wheel in the Dockerfile.

Also check the version tag of the pytest executor in the CircleCI config file and increment the version number. At the time of writing that version is v0.1.4.

executors:
  pytest:
    docker:
      - image: databricksdocs/pytest:v0.1.4

So for the purposes of this document we'll be building and pushing v0.1.5.

export pytest_version=v0.1.5

docker build -t databricksdocs/pytest:${pytest_version} -f shared/docker/pytest/Dockerfile .

You'll want to get some coffee or go to a movie or something while this builds. There are a lot of Python dependencies required to run the feature store code and almost none of them have binary versions available so the build will be doing some compiling. Give it a good 30-40 minutes to be sure.

Run tests locally

If you've not died of old age when the build is done, you should check that the built image works. This is simple and fast, all you have to do is run the image against your local copy of the docs repository.

export ext_dir=$(cd shared/extensions&&pwd)

docker run --rm -v $(pwd)shared/extensions:/extensions --rm databricksdocs/pytest:${pytest_version} pytest -l -s -vv /extensions

If you get valid test results in the output of this run command you know the build worked, you've got a working pytest image.

Push the image

Now that you know the image works you can push it to the databricksdocs/pytest Docker repository.

docker push databricksdocs/pytest:${pytest_version}
Update the CI

Finally, update the pytest executors in both of the CirleCI config files.

The executors section should be at the top of the file, make sure to replace the version that's there with the one you just built.

executors:
  pytest:
    docker:
      - image: databricksdocs/pytest:v0.1.5

Tag summary

Content type

Image

Digest

sha256:12ee018c3

Size

3.5 GB

Last updated

about 3 years ago

docker pull databricksdocs/pytest