Skip to content

Instantly share code, notes, and snippets.

@adsteel
Last active March 28, 2019 21:43
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save adsteel/862174048417a80ef89d to your computer and use it in GitHub Desktop.
Save adsteel/862174048417a80ef89d to your computer and use it in GitHub Desktop.
Run CircleCI Locally

SSH into the tests, run them locally in a browser

Get dependencies

$ brew install caskroom/cask/brew-cask
$ brew cask install chicken

Run tests in SSH on CircleCI

  • Rebuild your tests from the rebuild drop menu, selecting "Rebuild with SSH"
  • Wait until information about your SSH session appears on the screen (about 1 minute)

SSH info will look something like "ssh -p 64692 ubuntu@54.158.160.160 -L 5902:localhost:5901"

In your terminal

  • Enter the SSH info you got from the browser. This will open an ubuntu box on your command line. Enter the command below into that box.
$ <ssh-info>
ubuntu@box559:~$ vnc4server -geometry 1280x1024 -depth 24

Open VNC GUI (e.g. Chicken)

  • If you installed Chicken from the command line, open it from your applications folder
  • Choose port 5902 (You can confirm the port number in the SSH info)
  • Connect

This will open a VNC terminal.

In your VNC terminal

$ export DISPLAY=:1.0
$ cd app_name/ # you may need to get the name of your app folder with "$ ls"
$ bundle exec cucumber

To stop a test, add a binding.pry and repush.

@sethkrasnianski
Copy link

I find it less time consuming to just ssh into the CircleCI server while connecting through VNC and adding the binding.prys in real time, then rerun the specific test within the VNC terminal that's causing issues. Saves the hassle of waiting for circle to setup the containers and whatnot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment