Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Add travis integration #1505

Merged

Conversation

KeyserSosa
Copy link
Contributor

The only way to test travis is to deploy to master with a .travis.yml file and wait for travis-ci to pick up the change. To do some pre-testing here, the Vagrantfile has been split into two distinct machines:

  • default is, as before, the full reddit build (we have an opportunity to rename this)
  • travis is a minimal install with only the packages and services required to run nosetests against the codebase. It tries to mimic what will happen when we try to build this on travis-ci's workers.

As part of this addition, I've moved install-reddit.sh to install/reddit.sh and populated that install folder with common scripts used for both default and travis builds.

@KeyserSosa
Copy link
Contributor Author

👓 @bsimpson63 @spladug @ketralnis

Most of the new shell scripts are just copy-paste from the original install-reddit.sh. For the remaining bits, I used all ten of my thumbs.

The sticky points were either around permissions or removing stock packages that travis installs by default. Specifically:

  • There is a script to downgrade cassandra, since their default is 2.0
  • There are some dpkg and apt acrobatics (aptobatics?) to uninstall their libmemcached and substitute our own.

Most importantly:

screenshot 2016-01-12 16 21 53

@jedberg
Copy link
Contributor

jedberg commented Jan 13, 2016

Continuous integration for reddit? Did I just see flying bacon? :P

echo "additional setup already run"
fi
SCRIPT
config.vm.define "default" do |redditlocal|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: will need to do vagrant up default to name the VM and ensure that this block runs

@bsimpson63
Copy link
Contributor

Maybe not worth worrying about yet, but how will plugins work with this?

system_site_packages: true

services:
- cassandra
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it just much faster to include cassandra as a service rather than installing it in travis.sh, even with the downgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll give it a try without this line to see if it can still attach to a by-hand allocated cassandra service. I can't see why it wouldn't.

@bsimpson63
Copy link
Contributor

💅 looks great, just a couple questions

@KeyserSosa
Copy link
Contributor Author

💇

@spladug
Copy link
Contributor

spladug commented Jan 14, 2016

To keep cool URLs in docs etc. could install-reddit.sh still exist and just link to install/reddit.sh?

# up the build. This will *not* be the same environment as
# travis, but it should be useful for repairing broken tests.
#
# To start your vagrant box simply enter `vagrant up default` from {ROOTDIR}/reddit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean people will have to add "default" every time they want to up a default install? Could that be... defaulted for ergonomics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On closer reading of the Vagrant docs it looks like yes. [Unfortunately they don't say as much until several sections after they say "Commands that only make sense to target a single machine, such as vagrant ssh, now require the name of the machine to control." which initially threw me.]

@spladug
Copy link
Contributor

spladug commented Jan 14, 2016

🔕 pet peeve: "setup" is a noun not a verb!

@spladug
Copy link
Contributor

spladug commented Jan 14, 2016

💅 i like splitting up the script, but i think there's still some work to reduce duplication and maintain ergonomics. awesome work getting it to build on travis, loving those green checkmarks!

@KeyserSosa
Copy link
Contributor Author

💇

@spladug I think I addressed everything except 'setup' (though I at least fixed the comments that I added). Do you want me to rename the scripts set_up_* or turn it into a suffix _setup.sh?

sudo service cassandra start

# check each port for connectivity
echo "Waiting for cassandra to be available, see source for port meanings..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the part about "see source for port meanings" isn't necessary anymore

also no longer "each port"

@bsimpson63
Copy link
Contributor

🐟 lgtm

@KeyserSosa KeyserSosa changed the title First attempt at .travis.yml Add travis integration Jan 14, 2016
@spladug
Copy link
Contributor

spladug commented Jan 14, 2016

🐟 looks great! thanks for all that

The only way to test travis is to deploy to master with a `.travis.yml` file and wait for travis-ci to pick up the change.  To do some pre-testing here, the `Vagrantfile` has been split into two distinct machines:

 * `default` is, as before, the full reddit build (we have an opportunity to rename this)
 * `travis` is a minimal install with only the packages and services required to run `nosetests` against the codebase.  It tries to mimic what will happen when we try to build this on travis-ci's workers.

As part of this addition, I've moved `install-reddit.sh` to `install/reddit.sh` and populated that `install` folder with common scripts used for both `default` and `travis` builds.
@KeyserSosa KeyserSosa merged commit 69698a9 into reddit-archive:master Jan 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants