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

add travis for continuous integration testing #15

Merged
merged 5 commits into from
Jul 22, 2020
Merged

Conversation

cesine
Copy link
Collaborator

@cesine cesine commented Jul 21, 2020

Why?

I found we were unable to compile our templates using node 12, so I wanted to add travis to this project to be able to test updating to a new version of eco.

I also found that this fixes #14

How this was tested

I enabled travis on my fork cesine#2, and used it to find which versions of node still worked. I found a pretty positive result, this repo can still run with node versions 6 and above. It will be able to work with node 0.12 in the future if the ejs patch is accepted so i kept 0.12 in the list of versions in the travis.yml.

Screen Shot 2020-07-21 at 3 56 49 PM

Node <= 0.12 https://travis-ci.com/github/cesine/grunt-eco/jobs/363481531 fails due to mde/ejs#534

/home/travis/build/cesine/grunt-eco/node_modules/grunt-contrib-nodeunit/node_modules/nodeunit-x/node_modules/ejs/postinstall.js:9
let envDisable = isTrue(process.env.DISABLE_OPENCOLLECTIVE) || isTrue(process.
^^^
SyntaxError: Unexpected strict mode reserved word

Node <= 6 https://travis-ci.com/github/cesine/grunt-eco/jobs/363475715 fails due to mkdirp

$ grunt
/home/travis/build/cesine/grunt-eco/node_modules/mkdirp/lib/opts-arg.js:7
    opts = { mode: 0o777, fs, ...opts }
                              ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/travis/build/cesine/grunt-eco/node_modules/mkdirp/index.js:1:79)
The command "grunt" exited with 1.
cache.2
store build cache
0.00s1.62snothing changed
Done. Your build exited with 1.
$ npm ls mkdirp
grunt-eco@0.1.3 /Users/gchiodo/git/grunt-eco
├─┬ grunt@1.2.1
│ └── mkdirp@1.0.4
└─┬ grunt-contrib-nodeunit@2.1.0
  └─┬ nodeunit-x@0.13.0
    └─┬ tap@12.7.0
      ├── mkdirp@0.5.5
      └─┬ nyc@14.1.1
        └─┬ spawn-wrap@1.4.3
          └── mkdirp@0.5.5

The root cause is mkdir is using es6 after v 1.0.0 isaacs/node-mkdirp@ed0ae94#diff-3ca2c4508c333566c2fe17e2a75c5863

and grunt dropped support for older versions of node in gruntjs/grunt@4bfa98e#diff-b9cfc7f2cdf78a7f4b91a753d10865a2 v 1.1.0

  • Lock the dev deps of grunt to be able to verify older node versions are working with this lib in CI (keep the peer dep open-ended so that consumers have flexibilty)

Node > 8 https://travis-ci.com/github/cesine/grunt-eco/jobs/363475717#L216

$ grunt
(node:5175) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead.
Running "jshint:gruntfile" (jshint) task
>> 1 file lint free.
Running "jshint:tasks" (jshint) task
>> 1 file lint free.
Running "jshint:tests" (jshint) task
>> 1 file lint free.
Running "clean:test" (clean) task
>> 0 paths cleaned.
Running "eco:filesTest" (eco) task
File tmp/filesTest/all.js created.
File tmp/filesTest/flatOnly.js created.
Running "eco:srcDestTest" (eco) task
File tmp/srcDestTest/all.js created.
Running "eco:expandTest" (eco) task
File tmp/expandTest/tests/fixtures/advanced-example.js created.
File tmp/expandTest/tests/fixtures/empty.js created.
File tmp/expandTest/tests/fixtures/example.js created.
File tmp/expandTest/tests/fixtures/nested/example.js created.
Running "eco:basePathStringTest" (eco) task
File tmp/basePathStringTest/all.js created.
Running "eco:basePathFunctionTest" (eco) task
File tmp/basePathFunctionTest/all.js created.
Running "eco:amdTest" (eco) task
File tmp/amdTest/tests/fixtures/advanced-example.js created.
File tmp/amdTest/tests/fixtures/empty.js created.
File tmp/amdTest/tests/fixtures/example.js created.
File tmp/amdTest/tests/fixtures/nested/example.js created.
Running "eco:noJstGlobalCheckTest" (eco) task
File tmp/noJstGlobalCheckTest/all.js created.
Running "nodeunit:tests" (nodeunit) task
Testing eco_test.js.......OK
>> 12 assertions passed (6ms)
Done.
The command "grunt" exited with 0.
cache.2
store build cache
Done. Your build exited with 0.

@tommcc tommcc merged commit 6aac99e into tommcc:master Jul 22, 2020
@tommcc
Copy link
Owner

tommcc commented Jul 22, 2020

Thanks @cesine ! I no longer use this project, but I confirmed your PR does fix the tests. Are you interested in maintaining this project?

@cesine
Copy link
Collaborator Author

cesine commented Jul 22, 2020

Sure i can help maintain 👍 my user is also cesine on npm

@cesine cesine deleted the travis branch July 22, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get unit tests working again
2 participants