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

Commit

Permalink
Update packages and test harness (close snowplow#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamessnowplow authored and Paul Boocock committed Oct 31, 2019
1 parent 52b8391 commit 76e84e5
Show file tree
Hide file tree
Showing 28 changed files with 10,903 additions and 4,578 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ node_modules

**/lodash.js
tests/pages/*.js
tests/pages/integration.html
tests/micro.js
tests/local/serve/
tags/tag.min.js

Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
addons:
hosts:
- snowplow-js-tracker.local
node_js:
- 8.12.0
language: node_js
Expand All @@ -17,17 +20,10 @@ install:
- rm -rf node_modules
- npm install

- docker run --mount type=bind,source=$(pwd)/micro-config,destination=/config -p 9090:9090 snowplow/snowplow-micro:latest --collector-config /config/micro.conf --iglu /config/iglu.json > /dev/null 2>&1 &

# get ngrok
- wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
- unzip ./ngrok-stable-linux-amd64.zip
before_script:
- export SUBDOMAIN=$RANDOM$RANDOM
- ./ngrok http -authtoken $NGROK_AUTH -subdomain $SUBDOMAIN -log=stdout 9090 > /dev/null 2>&1 &
script:
- cd core && grunt intern && cd ..
- grunt travis
- grunt travis && npm run test:unit && npm run test:e2e:sauce
before_deploy:
- grunt default
deploy:
Expand Down
61 changes: 2 additions & 59 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,6 @@ module.exports = function(grunt) {
},
src: ['tags/tag.min.js'],
dest: 'tags/tag.min.js'
},
test: {
options: {
'process': true
},
files: {
'tests/pages/integration.html': 'tests/pages/integration-template.html',
'tests/micro.js': 'tests/micro-template.js'
}
},
local: {
options: {
'process': function(src, filepath) {
return src.replace(/'\<\%= subdomain \%\>' \+ '\.ngrok\.io'/g, '\'127.0.0.1:9090\'');
}
},
files: {
'tests/pages/integration.html': 'tests/pages/integration-template.html',
'tests/micro.js': 'tests/micro-template.js'
}
}
},

Expand All @@ -160,49 +140,12 @@ module.exports = function(grunt) {
'tags/tag.min.js': ['tags/tag.js']
}
}
},

intern: {
// Common
options: {
config: 'tests/intern.js'
},

nonfunctional: {
options: {
runType: 'client',
suites: [
'tests/nonfunctional/helpers.js',
'tests/nonfunctional/in_queue.js',
'tests/nonfunctional/proxies.js'
]
}
},
functional: {
options: {
runType: 'runner',
functionalSuites: [
'tests/functional/detectors.js',
'tests/functional/helpers.js'
]
}
},
integration: {
options: {
runType: 'runner',
functionalSuites: [
'tests/integration/setup.js', // required prior to integration.js
'tests/integration/integration.js' // request_recorder and ngrok need to be running
]
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-aws');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('intern');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-babel');

Expand Down Expand Up @@ -276,8 +219,8 @@ module.exports = function(grunt) {
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'browserify:main', 'babel:dist', 'concat:deploy', 'uglify:deploy', 's3:not_pinned', 'cloudfront:not_pinned']);
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'browserify:main', 'babel:dist', 'concat:deploy', 'uglify:deploy', 's3', 'cloudfront']);
grunt.registerTask('quick', 'Build snowplow.js, skipping building and minifying', ['browserify:main', 'babel:dist', 'concat:deploy']);
grunt.registerTask('test', 'Intern tests', ['browserify:test', 'babel:test', 'intern']);
grunt.registerTask('travis', 'Intern tests for Travis CI', ['concat:test', 'browserify:test', 'babel:test', 'intern']);
grunt.registerTask('test', 'Intern tests', ['browserify:test', 'babel:test']);
grunt.registerTask('travis', 'Intern tests for Travis CI', ['browserify:test', 'babel:test']);
grunt.registerTask('tags', 'Minifiy the Snowplow invocation tag', ['uglify:tag', 'concat:tag']);
grunt.registerTask('local', 'Builds and places files read to serve and test locally', ['browserify:test', 'babel:test',
'babel:local', 'concat:local']);
Expand Down
Loading

0 comments on commit 76e84e5

Please sign in to comment.