Commit fbe7bd60 authored by André Anjos's avatar André Anjos

Merge branch 'fix-ci' into 'master'

Use relative path to change to conda/js dir during test

See merge request !57
parents f45ee9fd de4b642c
Pipeline #27499 passed with stages
in 31 minutes
......@@ -112,3 +112,5 @@ conda-bld/
# built JS files
beat/editor/js
prefix/
conda/js/package.json
conda/js/webpack.config.js
......@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"start": "cross-env NODE_ENV=debug webpack-dev-server --hot",
"prebuild": "rimraf ../../beat/editor/js",
"prebuild": "rimraf %%jsfiles%%",
"build": "cross-env NODE_ENV=production webpack",
"test-start": "cross-env BABEL_ENV=test NODE_ENV=test karma start --no-single-run",
"test": "cross-env BABEL_ENV=test NODE_ENV=test karma start",
......
......@@ -57,7 +57,7 @@ export class Settings extends React.PureComponent<Props> {
)
}
</Form>
<a href='https://gitlab.idiap.ch/jdiefenbaugh/beat.editor'>Github</a>
<a href='https://gitlab.idiap.ch/beat/beat.editor'>Github</a>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.save}>Write Settings to server</Button>
......
......@@ -5,7 +5,7 @@ const VisualizerPlugin = require('webpack-visualizer-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin')
const dist = resolve(__dirname, '../../beat/editor/js');
const dist = resolve(__dirname, '%%jsfiles%%');
const isExternal = (module) => module.context && module.context.indexOf('node_modules') === -1;
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Ensures the editor JS code is available during tests'''
import os
import sys
import glob
key = '%%jsfiles%%'
scriptdir = os.path.realpath(os.path.dirname(sys.argv[0]))
try:
import pkg_resources
import beat.editorx
jsfiles = pkg_resources.resource_filename(beat.editor.__name__, 'js')
print('Running test (beat.editor import suceeded) - setting javascript path to %s' % jsfiles)
except ImportError as e:
jsfiles = os.path.realpath(os.path.join(scriptdir, '..', 'beat', 'editor',
'js'))
print('Running build (beat.editor import failed) - setting javascript path to %s' % jsfiles)
if not os.path.exists(jsfiles):
print(' Creating directory %s' % jsfiles)
os.makedirs(jsfiles)
templatedir = os.path.realpath(os.path.join(scriptdir, 'js'))
for k in glob.glob(os.path.join(templatedir, '*.template')):
output = os.path.splitext(k)[0]
print(' ** Replacing template %s -> %s' % (k, output))
with open(k, 'rt') as reader, open(output, 'wt') as writer:
for line in reader:
if key in line: line = line.replace(key, jsfiles)
writer.writelines([line])
......@@ -9,10 +9,13 @@ build:
run_exports:
- {{ pin_subpackage(name) }}
script:
- cd {{ environ.get('RECIPE_DIR') }}/js
- cd {{ environ.get('RECIPE_DIR') }}
- python linkeditor.py
- cd js
- npm install
- npm run build
- cd {{ environ.get('RECIPE_DIR') + '/..' }}
- git clean -qffdx .
- cd ../..
{% if environ.get('BUILD_EGG') %}
- python setup.py sdist --formats=zip
{% endif %}
......@@ -44,6 +47,7 @@ test:
files:
- js
- linkeditor.py
requires:
- bob-devel {{ bob_devel }}.*
......@@ -63,7 +67,7 @@ test:
- beat editor serve --help
- nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
- export CHROMIUM_BIN=chromium-browser
- if [ -n "${BEAT_BROWSER_TESTS}" ]; then pushd {{ environ.get('RECIPE_DIR') }}/js; npm install; npm test; popd; fi
- if [ -n "${BEAT_BROWSER_TESTS}" ]; then python linkeditor.py; cd js; npm install; npm test; cd -; fi
- unset CHROMIUM_BIN
- sphinx-build -aEW ${PREFIX}/share/doc/{{ name }}/doc sphinx
- if [ -n "${CI_PROJECT_DIR}" ]; then mv sphinx "${CI_PROJECT_DIR}/"; fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment