-
Notifications
You must be signed in to change notification settings - Fork 2k
Build suite #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Build suite #141
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a98d1ce
Adding dante to travis
5b8dabc
Adding sudo privileges to wget
78b75b4
Make dante executable
0f816eb
Write dante binary, not wget log
eebc0d5
Remove sudo from dante
a819d70
Add tests and generate inventory.yml file
88361c8
Removed commented out line
474d548
Ensure git and https are available on all images for smoke testing
9e7a889
Only log npm test if test fails
a1a31f0
Parallel builds
1036c55
Don't print npm logs, and handle exit manually for smoke_tests
8b1245f
Add build-essential for cheerio makefile
eafde9d
Generate inventory.yml on travis build
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| \.~tmp*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env bash | ||
| INVENTORY="images:" | ||
|
|
||
| gen_entry () { | ||
| INVENTORY=$INVENTORY" | ||
| - name: \"node:$2\" | ||
| path: \"$1\" | ||
| test: [\"./tests/smoke-tests/\",\"./tests/versions\"]" | ||
| } | ||
|
|
||
| for version in $(find . -name '[0-9]*\.[0-9]*' -type d); do | ||
| for dir in $(find "$version" -type d); do | ||
| tag=$(echo "$dir" | sed 's/\.\///' | sed 's/\//-/') | ||
| gen_entry "$dir" "$tag" | ||
| done | ||
| done | ||
|
|
||
| echo -e "$INVENTORY" > inventory.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| images: | ||
| - name: "node:0.10" | ||
| path: "./0.10" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.10-onbuild" | ||
| path: "./0.10/onbuild" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.10-slim" | ||
| path: "./0.10/slim" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.10-wheezy" | ||
| path: "./0.10/wheezy" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:4.4" | ||
| path: "./4.4" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:4.4-onbuild" | ||
| path: "./4.4/onbuild" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:4.4-slim" | ||
| path: "./4.4/slim" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:4.4-wheezy" | ||
| path: "./4.4/wheezy" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.12" | ||
| path: "./0.12" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.12-onbuild" | ||
| path: "./0.12/onbuild" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.12-slim" | ||
| path: "./0.12/slim" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:0.12-wheezy" | ||
| path: "./0.12/wheezy" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:5.10" | ||
| path: "./5.10" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:5.10-onbuild" | ||
| path: "./5.10/onbuild" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:5.10-slim" | ||
| path: "./5.10/slim" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
| - name: "node:5.10-wheezy" | ||
| path: "./5.10/wheezy" | ||
| test: ["./tests/smoke-tests/","./tests/versions"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| RUN apt-get update \ | ||
| && apt-get install -y --force-yes --no-install-recommends\ | ||
| git \ | ||
| ca-certificates \ | ||
| build-essential \ | ||
| ssh-client \ | ||
| && rm -rf /var/lib/apt/lists/*; | ||
|
|
||
| ENV NODE_ENV dev | ||
| RUN mkdir -p /usr/src/app | ||
| WORKDIR /usr/src/app | ||
| RUN npm config set spin=false | ||
| ADD ./smoke_test.sh ./smoke_test.sh | ||
| RUN chmod +x ./smoke_test.sh | ||
| RUN ./smoke_test.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "comment": "This satisifies the onbuild triggers" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #!/usr/bin/env bash | ||
| # ============================================================================= | ||
| # | ||
| # smoke_test.sh | ||
| # | ||
| # This script clones down a set of popular npm packages and runs their unit | ||
| # tests. This can be used to help verify a stable Node and npm install. | ||
| # | ||
| # ============================================================================= | ||
|
|
||
| # Define a set of tuples that are used to clone npm projects for testing | ||
| # Note: Bash doesn't suppor tuples, so we have 4 arrays. | ||
| REPOS=( | ||
| "https://github.com/caolan/async" | ||
| "https://github.com/tj/commander.js" | ||
| "https://github.com/substack/node-mkdirp" | ||
| "https://github.com/rvagg/through2" | ||
| "https://github.com/isaacs/node-glob" | ||
| "https://github.com/broofa/node-uuid" | ||
| "https://github.com/cheeriojs/cheerio" | ||
| "https://github.com/kriskowal/q" | ||
| ) | ||
|
|
||
| BRANCHES=( | ||
| "2.x" | ||
| "master" | ||
| "master" | ||
| "master" | ||
| "master" | ||
| "master" | ||
| "master" | ||
| "v1" | ||
| ) | ||
|
|
||
| DIRS=( | ||
| "async" | ||
| "commander" | ||
| "mkdirp" | ||
| "through2" | ||
| "glob" | ||
| "uuid" | ||
| "cheerio" | ||
| "q" | ||
| ) | ||
|
|
||
| TESTS=( | ||
| "nodeunit-test" | ||
| "test" | ||
| "test" | ||
| "test" | ||
| "test" | ||
| "test" | ||
| "test" | ||
| "test" | ||
| ) | ||
|
|
||
| # Keep track of where we started before we cd around | ||
| CWD=$PWD | ||
|
|
||
| # Iterate through all tuples in the set defined above | ||
| for i in `seq 3 $(expr ${#REPOS[@]} - 1)`; do | ||
| # Break tuple apart into components | ||
| REPO=${REPOS[$i]} | ||
| BRANCH=${BRANCHES[$i]} | ||
| DIR=${DIRS[$i]} | ||
| TEST=${TESTS[$i]} | ||
|
|
||
| # Clone an npm package from github, install its deps, and then test it. | ||
| echo "--> Cloning $DIR" | ||
| git clone --recursive --depth 1 --branch $BRANCH $REPO $DIR | ||
| cd $DIR | ||
| echo "--> Setting up $DIR" | ||
| install_log=$(npm install 2>&1) | ||
| if [ $? -ne 0 ]; then | ||
| echo -e "$install_log" | ||
| exit 1 | ||
| fi | ||
| echo "--> Testing $DIR" | ||
| # Only log error if tests fail | ||
| run_log=$(npm run "$TEST" 2>&1) | ||
| if [ $? -ne 0 ]; then | ||
| echo -e "$run_log" | ||
| exit 1 | ||
| fi | ||
| cd $CWD | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # This simply documents the versions of Node.js and npm installed, along with | ||
| # the versions of the linked library availble to the runtime. This provides | ||
| # an audit trail for buggy builds | ||
| RUN node -v | ||
| RUN node -p "process.versions" | ||
| RUN npm --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "comment": "This satisifies the onbuild triggers" | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.