Skip to content
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

Smoke Tests #492

Merged
merged 32 commits into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0f0c6c2
Add smoke tests and harness
kangax Dec 21, 2016
e3f8feb
Add submodules
kangax Dec 21, 2016
155a5c1
Add draft-js
kangax Dec 21, 2016
9becabc
Add html-minifier
kangax Dec 21, 2016
83b3ec2
Fix linter
kangax Dec 21, 2016
9de196f
Add submodules
kangax Dec 21, 2016
adcf860
Add remaining modules
kangax Dec 21, 2016
d04495c
Add support for Babili options (doesn't work coz we need to publish i…
kangax Dec 21, 2016
ea3c9c9
Reorganize harness so that tests can run consecutively
kangax Dec 21, 2016
3b1c539
Fix linter
kangax Dec 21, 2016
01a9c33
Add babel and stylelint to submodules
kangax Dec 22, 2016
ff3345d
Add support for minifying multiple files
kangax Dec 22, 2016
059e386
Move ignore into options
kangax Dec 22, 2016
0513b02
Add verbose option, run w. both es2015 and without
kangax Jan 6, 2017
f83f4cc
Update smoke tests
kangax Jan 17, 2017
9a9c819
Move directories to smoke/assets
boopathi Apr 4, 2017
f2e2e85
SmokeTest class and promises
boopathi Apr 5, 2017
7e49e3b
Fix for immutable js
boopathi Apr 5, 2017
c7ac88a
Update URL for submodules
boopathi Apr 5, 2017
8c7bd1f
Fix for HTML-minifier and add ignore=dirty for submodules
boopathi Apr 5, 2017
31477ba
Move smoke test scripts to smoke dir
boopathi Apr 5, 2017
192d210
move jquery to passed tests
vigneshshanmugam Apr 6, 2017
daae6f5
Update travis to run smoke tests
boopathi Apr 6, 2017
1936af1
Add before script step to bootstrap and build for all items in matrix
boopathi Apr 6, 2017
474fa69
add lodash to smoke tests
vigneshshanmugam Apr 6, 2017
dd397b9
Add cleanup step and skip-* steps
boopathi Apr 6, 2017
105b863
Add lodash to travis.yml
boopathi Apr 6, 2017
f194aee
fix the lodash path
vigneshshanmugam Apr 6, 2017
cd92a78
fix lodash test and remove build step
vigneshshanmugam Apr 6, 2017
3ed5fcb
Add breaking tests to verify we are modifying the correct files
boopathi Apr 6, 2017
b8fe4ce
Add g++-4.9 for compiling immutable-js deps which fails on CI
boopathi Apr 6, 2017
3a7887a
Fix promise chain
boopathi Apr 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[submodule "smoke/assets/immutable-js"]
path = smoke/assets/immutable-js
url = https://github.com/facebook/immutable-js
ignore = dirty
[submodule "smoke/assets/jquery"]
path = smoke/assets/jquery
url = https://github.com/jquery/jquery
ignore = dirty
[submodule "smoke/assets/draft-js"]
path = smoke/assets/draft-js
url = https://github.com/facebook/draft-js
ignore = dirty
[submodule "smoke/assets/html-minifier"]
path = smoke/assets/html-minifier
url = https://github.com/kangax/html-minifier
ignore = dirty
[submodule "smoke/assets/lodash"]
path = smoke/assets/lodash
url = https://github.com/lodash/lodash/
branch = 4.17.4
ignore = dirty
32 changes: 28 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,38 @@ node_js:
- '6'
- '4'

# For smoke tests
# for compiling immutable js
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9

env:
global:
- CXX=g++-4.9

before_script:
- yarn run bootstrap && yarn run build

script:
- 'if [ -n "${LINT-}" ]; then yarn run lint ; fi'
- yarn run test-ci
- if [ -n "${LINT-}" ]; then yarn run lint ; fi
- if [ -n "${SMOKE-}" ]; then node smoke/run.js $SMOKE; fi
- if [ -z "${SKIPTESTS-}" ]; then yarn run coverage; fi

matrix:
fast_finish: true
include:
- node_js: "node"
env: LINT=true
env: LINT=true SKIPTESTS=true
- node_js: "node"
env: SMOKE=html-minifier SKIPTESTS=true
- node_js: "node"
env: SMOKE=jquery SKIPTESTS=true
- node_js: "node"
env: SMOKE=immutable-js SKIPTESTS=true
- node_js: "node"
env: SMOKE=lodash SKIPTESTS=true

after_success: yarn run coverage-ci
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"eslint": "eslint packages/*/src/ packages/*/__tests__/ utils/*.js scripts/*.js",
"eslint-fix": "eslint --fix packages/*/src/ packages/*/__tests__/ utils/*.js scripts/*.js",
"fix": "npm run format && npm run eslint-fix",
"format-check": "git ls-files | egrep '.js$' | xargs prettier -l --print-width 80",
"format": "git ls-files | egrep '.js$' | xargs prettier --write --print-width 80",
"format-check": "git ls-files | egrep '\\.js$' | xargs prettier -l --print-width 80",
"format": "git ls-files | egrep '\\.js$' | xargs prettier --write --print-width 80",
"lint": "npm run format-check && npm run eslint",
"publish": "git pull origin master --rebase && npm run build && npm test && lerna publish",
"publish-internal": "git pull origin master --rebase && npm run build && NPM_DIST_TAG=internal ./node_modules/.bin/lerna publish --skip-git",
Expand Down
1 change: 1 addition & 0 deletions smoke/assets/draft-js
Submodule draft-js added at 8cd420
1 change: 1 addition & 0 deletions smoke/assets/html-minifier
Submodule html-minifier added at d8c868
1 change: 1 addition & 0 deletions smoke/assets/immutable-js
Submodule immutable-js added at 6a50e0
1 change: 1 addition & 0 deletions smoke/assets/jquery
Submodule jquery added at e1b1b2
1 change: 1 addition & 0 deletions smoke/assets/lodash
Submodule lodash added at 912d6b
18 changes: 18 additions & 0 deletions smoke/break.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";

module.exports = function BreakMeTransform({ types: t }) {
return {
visitor: {
AssignmentExpression(path) {
path.get("left").replaceWith(t.identifier("a"));
},
FunctionExpression(path) {
if (Math.random() * 100 > 50) {
const newNode = t.clone(path.node);
newNode.params = [];
path.replaceWith(newNode);
}
}
}
};
};
132 changes: 132 additions & 0 deletions smoke/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
const program = require("commander");
const smoke = require("./smoke-test.js");

const TESTS = [
{
dir: "html-minifier",
files: "src/htmlminifier.js",
build: "grunt dist",
test: "grunt qunit"
},
{
dir: "immutable-js",
files: "dist/immutable.js",
build: "npm run build:dist",
test: "npm run testonly",
babiliOptions: {
keepFnName: true,
unsafe: {
typeConstructors: false
}
}
},
{
dir: "jquery",
files: "dist/jquery.js",
build: "npm run build",
test: "grunt test"
},
{
dir: "lodash",
files: "lodash.js",
test: "npm run test:main",
babiliOptions: {
keepFnName: true
}
}
];

function run() {
let inputTests = [];
program
.usage("[options] [inputTests...]")
.action(_inputTests => inputTests = _inputTests)
.option("-i --skip-install", "Skip Install Step")
.option("-b --skip-build", "Skip Build step")
.option("-c --skip-cleanup", "Skip cleanup step")
.option("-q --quiet", "Quiet mode")
.parse(process.argv);

console.log("tests to run - ", inputTests);

const testsToRun = [];
for (let test of TESTS) {
if (inputTests.indexOf(test.dir) !== -1) {
testsToRun.push(test);
}
}

if (testsToRun.length < 1) {
throw new Error("No Test to run");
}

(function tick(test) {
smoke(test, {
skipInstall: program.skipInstall,
skipBuild: program.skipBuild,
verbose: !program.quiet
})
.then(() => {
const test = testsToRun.pop();
test && tick(test);
})
.catch(err => {
console.error(err);
process.exit(1);
});
})(testsToRun.pop());
}

/**
* Run the test
*/
run();

const otherTests = [
// {
// dir: "babel",
// files: "packages/babel-core/src/helpers/resolve.js",
// build: "make bootstrap",
// test: "make test-only",
// babelOptions: {
// plugins: ["syntax-flow"]
// }
// },
// {
// dir: "stylelint",
// files: "lib/**/*.js",
// ignore: [
// "**/__tests__/**",
// "**/lib/rules/declaration-block-properties-order/index.js",
// "**/lib/rules/declaration-block-no-redundant-longhand-properties/index.js",
// "**/lib/rules/at-rule-empty-line-before/index.js",
// "**/lib/rules/max-empty-lines/index.js",
// "**/lib/rules/block-closing-brace-newline-before/index.js",
// "**/lib/rules/function-calc-no-unspaced-operator/index.js",
// "**/lib/rules/font-weight-notation/index.js",
// "**/lib/rules/max-line-length/index.js",
// "**/lib/rules/selector-class-pattern/index.js",
// "**/lib/rules/declaration-colon-newline-after/index.js",
// ],
// build: "npm install",
// test: "npm run jest",
// success: "Test Suites: 264 passed, 264 total",
// },
// {
// dir: "react",
// files: "build/react.js",
// build: "npm install && npm run build",
// test: "npm test",
// },
// PASS
// {
// dir: "draft-js",
// files: "dist/Draft.js",
// build: "npm cache clean && npm install",
// test: "npm test",
// verbose: false
// },
/**
* PASSED AND VERIFIED
*/
];
Loading