Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 2 KB

File metadata and controls

63 lines (49 loc) · 2 KB

Testing

Developers can test using Vagrant and your Sourcegraph GCP account.

  • Use these instructions to install Vagrant on your local machine. Once sucessfully installed, install the required plugin:
vagrant plugin install vagrant-google
  • Ensure your credentials are correct by excecuting the command below and following the prompts:
gcloud auth application-default login
  • Configure your local variables using the following environment variables
    • VAGRANT_GCP_PROJECT_ID: Project to run on. (default: sourcegraph-server)
    • VAGRANT_SSH_USER: Your SSH user ID as specified in GCP metadata. (default: ENV['USER'])
    • VAGRANT_SSH_KEY: Path to your SSH Keys as specified in GCP metadata. (default: ~/.ssh/id_rsa)
    • TEST_TYPE: Deployment type to test, pure-docker-test or docker-compose-test.
.buildkite/vagrant-run.sh docker-test

This command will start a GCP instance, upload your local copy of the reposistory and run the relevant smoke test for each deployment type, pure-docker-test or docker-compose-test.

To run any additional tests or commands, edit servers.yaml and add the commands to the shell_commands list, eg:

shell_commands:
    - [...]
    - /vagrant/moretests.sh
    - "ps aux | grep thisthat"
    - |
      cd /vagrant
      bartest.sh

Smoke test: ensure Docker Compose upgrades work

Start the prior version of Docker Compose:

git checkout <previous_version_branch>
cd test/
TEST_TYPE=docker-compose-test vagrant up docker-test 

Wait for the test to pass and for the output (approximately 5-10 minutes):

docker-test: ALL TESTS PASSED

Update to the latest version:

git checkout master
TEST_TYPE=docker-compose-test vagrant provision docker-test

Wait for the test to pass and for the output (approximately 5-10 minutes):

docker-test: ALL TESTS PASSED