From b2db144c6bc37fa16185ebe65f2b8435f1cdfef7 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 10 May 2016 10:03:04 +0300 Subject: [PATCH] separate general e2e test from apis.guru --- .travis.yml | 9 ++++--- build/run_tests.sh | 2 +- tests/e2e/redoc.spec.js | 54 +++++++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 208306e8..44f98c58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,10 @@ branches: matrix: include: - env: JOB=e2e + - env: JOB=e2e-guru fast_finish: true allow_failures: - - env: JOB=e2e + - env: JOB=e2e-guru env: global: - GH_REF: github.com/Rebilly/ReDoc.git @@ -41,16 +42,16 @@ deploy: secure: PuhWLERrCEFmXmdFpw2OVFlqpOIVDmgwk5JUJOYaFdVCh/smp0+jZCQ4vrdFpuG96rnDVirD+A8xvW6NgsNNaRthLgOB/LRdFN69rU6Gvn3At6wlnC55t5dlhxPvCfnzJcHVBLXX4EmMkjnZqDg2uczXTzPodr3FnQJNuXmP8B33fzDVLyHccvXZ90abwXWVrgRIXPU28niqCR8DOC2OTzs7wqz+BLNkYDRRbyYXsg62HWuD33x5iof5IqBmhzBt3usCGmF3QGcgHrXHdZw3sZnit8+Bua++3KrXR0x6HGXXN1AoXVmCAkCa5OTQ5R3tCRxiJN3P2KLnvWeZR74sTFkovJB/6pGCvbJ/c7Wnuw6sD7SgOUBD359ULB6lAf5OnxBLoNebX4JxxVXF+zA4E3Bl44VxkzDpPWc15xqBPMB5vBREzMVmJ5mExn2s5cmLQjADbl9h0y6gZnhnNJ+iTmqtrVyM0ZkF2rPrzrTdGD+ULmRIlTMkdD1bh+/TJ3RdXT3P4/zNUJmiNnvgnnJVYYvsGaXWF+7uCVHT/8k2RsoSHqgkqh0gkDqGSwVix55y5mC7T2Vk9lMBhm6MvFJXaonOX0kxJS4EDQ3plPd6/ybG+TLhwggYnQ8o9msU5Nt6FpUShKiezjKurIhbQZdwlVivX3tahjW2QjNDO58xGgY= on: tags: true - condition: $JOB != e2e + condition: $JOB == e2e - skip_cleanup: true provider: script script: npm run branch-release on: branch: master - condition: $JOB != e2e + condition: $JOB == e2e - skip_cleanup: true provider: script script: npm run deploy on: tags: true - condition: $JOB != e2e + condition: $JOB == e2e diff --git a/build/run_tests.sh b/build/run_tests.sh index 308641bf..60ff52f8 100755 --- a/build/run_tests.sh +++ b/build/run_tests.sh @@ -1,5 +1,5 @@ #!/bin/bash -if [ "$JOB" = "e2e" ]; then +if [ "$JOB" = "e2e" ] || [ "$JOB" = "e2e-guru" ]; then npm run e2e else npm run unit diff --git a/tests/e2e/redoc.spec.js b/tests/e2e/redoc.spec.js index bc1fd6be..ace018ca 100644 --- a/tests/e2e/redoc.spec.js +++ b/tests/e2e/redoc.spec.js @@ -51,34 +51,36 @@ describe('Scroll sync', () => { }); }); -describe('APIs.guru specs test', ()=> { +if (process.env.JOB === 'e2e-guru') { + describe('APIs.guru specs test', ()=> { - // global.apisGuruList was loaded in onPrepare method of protractor config - let apisGuruList = global.apisGuruList; + // global.apisGuruList was loaded in onPrepare method of protractor config + let apisGuruList = global.apisGuruList; - // Remove certain APIs that are known to cause problems - delete apisGuruList['motaword.com']; // invalid (see https://github.com/BigstickCarpet/swagger-parser/issues/26) - delete apisGuruList['learnifier.com']; // allof object and no type - delete apisGuruList['googleapis.com:mirror']; // bad urls in images - delete apisGuruList['googleapis.com:discovery']; // non-string references - delete apisGuruList['clarify.io']; // non-string references - delete apisGuruList['pushpay.com']; // https://github.com/Rebilly/ReDoc/issues/30 + // Remove certain APIs that are known to cause problems + delete apisGuruList['motaword.com']; // invalid (see https://github.com/BigstickCarpet/swagger-parser/issues/26) + delete apisGuruList['learnifier.com']; // allof object and no type + delete apisGuruList['googleapis.com:mirror']; // bad urls in images + delete apisGuruList['googleapis.com:discovery']; // non-string references + delete apisGuruList['clarify.io']; // non-string references + delete apisGuruList['pushpay.com']; // https://github.com/Rebilly/ReDoc/issues/30 - // run quick version of e2e test on all builds except releases - if (process.env.TRAVIS && !process.env.TRAVIS_TAG) { - console.log('Running on short APIs guru list'); - apisGuruList = eachNth(apisGuruList, 10); - } else { - console.log('Running on full APIs guru list') - } + // run quick version of e2e test on all builds except releases + if (process.env.TRAVIS && !process.env.TRAVIS_TAG) { + console.log('Running on short APIs guru list'); + apisGuruList = eachNth(apisGuruList, 10); + } else { + console.log('Running on full APIs guru list') + } - for (let apiName of Object.keys(apisGuruList)) { - let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred]; - let url = apiInfo.swaggerUrl; + for (let apiName of Object.keys(apisGuruList)) { + let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred]; + let url = apiInfo.swaggerUrl; - // temporary hack due to this issue: https://github.com/substack/https-browserify/issues/6 - url = url.replace('https://', 'http://'); - url = url.replace('apis-guru.github.io/', 'apis-guru.github.io:80/'); - basicTests(url, `${apiName}:${apiInfo.info.version}\n${url}`); - } -}); + // temporary hack due to this issue: https://github.com/substack/https-browserify/issues/6 + url = url.replace('https://', 'http://'); + url = url.replace('apis-guru.github.io/', 'apis-guru.github.io:80/'); + basicTests(url, `${apiName}:${apiInfo.info.version}\n${url}`); + } + }); +}