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

figure out how to test the deploy command #34

Closed
mykmelez opened this issue Oct 7, 2015 · 4 comments
Closed

figure out how to test the deploy command #34

mykmelez opened this issue Oct 7, 2015 · 4 comments
Assignees
Milestone

Comments

@mykmelez
Copy link
Contributor

mykmelez commented Oct 7, 2015

We need to figure out how to test the deploy command.

We can create a local Git repository and bootstrap an app in it to deploy, but then there's the question of how to test that deployment pushes it to its origin remote, which is normally on GitHub.

But deploy doesn't actually depend on GitHub itself, only on there being an origin "remote", which could presumably be another local repository. So it should be possible to test deploy without a dependency on a GitHub server.

We would just need to create two local repositories, one of which has the other as its origin; build the app in the first repository; and then test that the deploy command pushes the build output to the gh-pages branch in the origin repository.

@marco-c
Copy link
Contributor

marco-c commented Oct 12, 2015

Looks interesting, I'll take a stab at it.

@marco-c marco-c self-assigned this Oct 12, 2015
@mykmelez
Copy link
Contributor Author

Marco, these tests broke the next time I merged a change to master (https://travis-ci.org/mozilla/oghliner/builds/85199186), because the tmp dir was apparently preserved across builds:

  1. Deploy should update the gh-pages branch in the origin repo and publish files to it:
    Error: EEXIST, file already exists 'tmp'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:747:18)
    at Context. (test/testDeploy.js:49:8)

@mykmelez mykmelez reopened this Oct 13, 2015
@brendandahl
Copy link
Contributor

The temp folder/file creation library I used in https://github.com/mozilla/oghliner/pull/63/files#diff-c792d04edfea01487109cfd6450c9ef8R4 worked pretty well.

@marco-c
Copy link
Contributor

marco-c commented Oct 13, 2015

@mykmelez I think it was a timeout, which then caused the "tmp" directory to be preserved and thus the second test to fail.
It's likely that the test could actually need more time, as in this successful build (https://travis-ci.org/mozilla/oghliner/builds/85199186, which is yours retriggered) the test took 673ms (which is relatively close to the current timeout of 2 seconds).

Let's file a new issue if it happens again.
I'll also submit a PR to avoid failing following tests when the first runs out of time.

@marco-c marco-c closed this as completed Oct 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants