Skip to content

bostongolang/golang-lab-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Boston Lab #2 - Testing

Welcome to the second Boston Go language lab!

The goal of this lab is to practice writing tests by create some unit tests for some open source projects.

We have identified some projects in the projects/ folders with instructions.

Prerequisites

  1. PLEASE BRING: A laptop with a Go language environment with Go 1.4 already set up. Please see 'Vagrant setup' below to get started with one easily.
  • If you are having trouble setting up your Go programming environment, please join the #lab-help channel in the Boston Golang Slack group. You can signup for the Slack group here.
  1. PLEASE BRING: A text editor or IDE suitable for writing Go code.
  • For beginners, Sublime is a good option. Make sure you install the Go plugin here.
  • For VIM users, there is a pretty nice VIM setup here.
  • For IDE users who want to use an IDE made for Go, LiteIDE is a good IDE that's easy to use.
  1. PLEASE HAVE: Some basic Go language exposure. You should be familiar with the Go basics: e.g., Go's types, structs, control flow structures, goroutines, and channels.
    Other programming language experience and concepts (such as networking, etc) will be helpful. A good introduction to the basics of Go for people familiar with other programming language is available at: https://tour.golang.org. If you can get through this tour, you will be well-prepared for this meetup!

General setup

  1. Fork this repository in Github.

  2. Clone the repository into a directory

# open a terminal window and type:
$ git clone https://github.com/bostongolang/golang-lab-testing.git

Vagrant setup

  1. Install Vagrant for your platform.
  2. Open a terminal window, and cd /path/to/this/repository.
# open a terminal window and type:
$ cd golang-lab-testing
  1. From within the golang-lab-testing directory, type vagrant up. This will create a virtual machine with Ubuntu linux and Go 1.4 installed for the Vagrant user.
  2. Type vagrant ssh to ssh into the virtual machine.

Within the virtual machine, golang-lab-testing on the host computer will be mapped to /opt/golang-lab-testing in the guest. So any changes you make in the normal filesystem should be reflected in the VM!

Need help? Arrive a little early and we can help you get up-and-running, or join the Boston Golang Slack group #lab-help channel group by signing up here.

You can also email me directly: [email protected].

Projects

Projects are organized into 'basic' and 'advanced'. Basic tests require very little experience and will walk you through the types of tests to create, the advanced tests are more free form (although some guidance is provided).

Projects are listed below roughly in order of least -> most difficult, also included is some basic background of knowledge/content you should have to be able to successfully write the tests:

Basic

  • timeago - no knowledge required
  • gocsv - knowledge of CSV files helpful
  • go-notify - basic knowledge of channels, goroutines helpful
  • passwd - knowledge of /etc/passwd files format (nice but not required)
  • sshconfig - knowledge of ~/.ssh/config files format (nice but not required)
  • redis - some knowledge of Redis helpful

Advanced

  • short - testing a web app with redis
  • koala - testing a command line tool for formatting file listing outputs

About

Resources for Boston Golang Lab #2: Testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages