Enkit (engineering toolkit)

Importing into a downstream Bazel workspace

When using enkit in a downstream workspace, there are two options for loading Go dependencies:

Testing

Setting up for tests

Install non-bazel managed dependencies

  1. google-cloud-sdk

    • Install here https://cloud.google.com/sdk/docs/install

      PLEASE NOTE: do not install using snap/brew/apt-get etc., as emulators do not work.

    • Run the following command to get access to the emulators:

      gcloud components install beta
      
    • Add the gcloud binary to the local binaries directory with the following symlink:

      ln -s $(which gcloud) /usr/local/bin
      
  2. Get a service account from <x, Y, Z person>

    • Put it in //astore/testdata/credentials.json

Examples of Running Tests

Adding Tests

  1. Create the test in * \_test.go

  2. Run Gazelle:

    bazel run //:gazelle
    
  3. If your test needs server dependencies, such as astore or minio, add the attribute local = True to the test rule.