feat: extend e2e procedure

This commit is contained in:
Rainer Killinger
2019-11-25 16:47:54 +01:00
parent 91de58b5ae
commit dc79dc8feb
3 changed files with 173 additions and 49 deletions

View File

@@ -12,13 +12,14 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThingType} from '@openstapps/core';
import {Logger} from '@openstapps/logger';
import * as commander from 'commander';
import {readFileSync} from 'fs';
import {join} from 'path';
import {URL} from 'url';
import {copy} from './copy';
import {indexSamples} from './e2e';
import {e2eRun} from './e2e';
import {HttpClient} from './http-client';
const pkgJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'))
@@ -34,7 +35,7 @@ process.on('unhandledRejection', async (error) => {
commander
.command('e2e <to>')
.description('Run in end to end test mode. Indexing all test files from @openstapp/core to the backend')
.description('Run in end to end test mode. Indexing and afterwards retrieving all test files from @openstapp/core to the backend')
.option('-s --samples [path]', 'Path to @openstapp/core test files', './node_modules/@openstapps/core/test/resources')
.action(async (to, e2eCommand) => {
let toURL = '';
@@ -49,7 +50,7 @@ commander
actionDone = true;
indexSamples(client, {to: toURL, samples: e2eCommand.samples})
e2eRun(client, {to: toURL, samplesLocation: e2eCommand.samples})
.then(() => {
Logger.ok('Done');
})
@@ -108,7 +109,7 @@ commander
from: fromURL,
source: copyCommand.bulkSource,
to: toURL,
type: type,
type: type as SCThingType,
version: copyCommand.appVersion,
})
.then(() => {