LP#1662297: avoid hardcoded install path in web client build tests
authorJeff Davis <jeff.davis@bc.libraries.coop>
Wed, 31 Jul 2019 23:08:18 +0000 (16:08 -0700)
committerJeff Davis <jeff.davis@bc.libraries.coop>
Thu, 1 Aug 2019 21:32:02 +0000 (14:32 -0700)
As a result of this change, you must run configure and make before
building the web client.

Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
.gitignore
Open-ILS/src/Makefile.am
Open-ILS/src/eg2/karma.conf.js [deleted file]
Open-ILS/src/eg2/karma.conf.js.in [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/test/karma.conf.js [deleted file]
Open-ILS/web/js/ui/default/staff/test/karma.conf.js.in [new file with mode: 0644]
docs/installation/server_installation.adoc

index 9ba89b7..333730a 100644 (file)
@@ -338,6 +338,8 @@ Open-ILS/src/support-scripts/eg_db_config
 Open-ILS/examples/apache_24/eg_24.conf
 Open-ILS/examples/apache_24/eg_startup
 Open-ILS/examples/apache_24/eg_vhost_24.conf
+Open-ILS/web/js/ui/default/staff/test/karma.conf.js
+Open-ILS/src/eg2/karma.conf.js
 Open-ILS/src/c-apps/tests/.deps/
 Open-ILS/xul/staff_client/external/libmar/config.h
 Open-ILS/xul/staff_client/external/libmar/config.h.in
index 9420028..015542d 100644 (file)
@@ -144,13 +144,18 @@ gen_docs = \
        $(examples)/apache_24/eg_24.conf \
        $(examples)/apache_24/eg_vhost_24.conf
 
+# karma conf for web client build tests
+gen_karma_conf = \
+       @top_srcdir@/Open-ILS/web/js/ui/default/staff/test/karma.conf.js \
+       @srcdir@/eg2/karma.conf.js
+
 bin_SCRIPTS = $(core_scripts) $(gen_scripts) $(reporter_scripts) $(installautojs)
 
 CLEANFILES = $(gen_scripts)
 
 data_DATA = $(core_data) $(reporter_data)
 
-doc_DATA = $(gen_docs)
+doc_DATA = $(gen_docs) $(gen_karma_conf)
 
 # Take care of which subdirectories to build, and which extra files to include in a distribution.
 
@@ -163,6 +168,7 @@ EXTRA_DIST = @srcdir@/perlmods \
        @srcdir@/cgi-bin \
        $(gen_scripts) \
        $(gen_docs) \
+       $(gen_karma_conf) \
        @srcdir@/extras/eg_config
 
 do_subst = $(SED) \
@@ -248,6 +254,12 @@ $(examples)/apache_24/eg_24.conf: Makefile $(examples)/apache_24/eg.conf.in
 $(examples)/apache_24/eg_vhost_24.conf: Makefile $(examples)/apache_24/eg_vhost.conf.in
        $(do_subst) $(examples)/apache_24/eg_vhost.conf.in > "$@"
 
+@top_srcdir@/Open-ILS/web/js/ui/default/staff/test/karma.conf.js: Makefile @top_srcdir@/Open-ILS/web/js/ui/default/staff/test/karma.conf.js.in
+       $(do_subst) @top_srcdir@/Open-ILS/web/js/ui/default/staff/test/karma.conf.js.in > "$@"
+
+@srcdir@/eg2/karma.conf.js: Makefile @srcdir@/eg2/karma.conf.js.in
+       $(do_subst) @srcdir@/eg2/karma.conf.js.in > "$@"
+
 #perl-install and string-templates-install     
 ilscore-install:
        @echo $@
diff --git a/Open-ILS/src/eg2/karma.conf.js b/Open-ILS/src/eg2/karma.conf.js
deleted file mode 100644 (file)
index 63982de..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Karma configuration file, see link for more information
-// https://karma-runner.github.io/1.0/config/configuration-file.html
-
-module.exports = function (config) {
-  config.set({
-    basePath: '',
-    frameworks: ['jasmine', '@angular-devkit/build-angular'],
-    plugins: [
-      require('karma-jasmine'),
-      require('karma-chrome-launcher'),
-      require('karma-phantomjs-launcher'),
-      require('karma-jasmine-html-reporter'),
-      require('karma-coverage-istanbul-reporter'),
-      require('@angular-devkit/build-angular/plugins/karma')
-    ],
-    client:{
-      clearContext: false // leave Jasmine Spec Runner output visible in browser
-    },
-    coverageIstanbulReporter: {
-      dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
-      fixWebpackSourcePaths: true
-    },
-    angularCli: {
-      environment: 'dev'
-    },
-    reporters: ['progress', 'kjhtml'],
-    port: 9876,
-    colors: true,
-    logLevel: config.LOG_INFO,
-    autoWatch: true,
-    browsers: ['PhantomJS'],
-    singleRun: true,
-    files: [
-      '/openils/lib/javascript/md5.js',
-      '/openils/lib/javascript/JSON_v1.js',
-      '/openils/lib/javascript/opensrf.js',
-      '/openils/lib/javascript/opensrf_ws.js',
-      // mock data for testing only
-      'src/test_data/IDL2js.js',
-      'src/test_data/eg_mock.js',
-    ]
-  });
-};
diff --git a/Open-ILS/src/eg2/karma.conf.js.in b/Open-ILS/src/eg2/karma.conf.js.in
new file mode 100644 (file)
index 0000000..eba7ee8
--- /dev/null
@@ -0,0 +1,43 @@
+// Karma configuration file, see link for more information
+// https://karma-runner.github.io/1.0/config/configuration-file.html
+
+module.exports = function (config) {
+  config.set({
+    basePath: '',
+    frameworks: ['jasmine', '@angular-devkit/build-angular'],
+    plugins: [
+      require('karma-jasmine'),
+      require('karma-chrome-launcher'),
+      require('karma-phantomjs-launcher'),
+      require('karma-jasmine-html-reporter'),
+      require('karma-coverage-istanbul-reporter'),
+      require('@angular-devkit/build-angular/plugins/karma')
+    ],
+    client:{
+      clearContext: false // leave Jasmine Spec Runner output visible in browser
+    },
+    coverageIstanbulReporter: {
+      dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
+      fixWebpackSourcePaths: true
+    },
+    angularCli: {
+      environment: 'dev'
+    },
+    reporters: ['progress', 'kjhtml'],
+    port: 9876,
+    colors: true,
+    logLevel: config.LOG_INFO,
+    autoWatch: true,
+    browsers: ['PhantomJS'],
+    singleRun: true,
+    files: [
+      '@libdir@/javascript/md5.js',
+      '@libdir@/javascript/JSON_v1.js',
+      '@libdir@/javascript/opensrf.js',
+      '@libdir@/javascript/opensrf_ws.js',
+      // mock data for testing only
+      'src/test_data/IDL2js.js',
+      'src/test_data/eg_mock.js',
+    ]
+  });
+};
diff --git a/Open-ILS/web/js/ui/default/staff/test/karma.conf.js b/Open-ILS/web/js/ui/default/staff/test/karma.conf.js
deleted file mode 100644 (file)
index 987d216..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-module.exports = function(config){
-    config.set({
-    basePath : '../',
-
-    // config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
-    logLevel: config.LOG_INFO,
-
-    files : [
-      'build/js/vendor.bundle.js',
-      'build/js/core.bundle.js',
-      'node_modules/angular-mocks/angular-mocks.js', // testing only
-      'node_modules/angular-file-saver/dist/angular-file-saver.bundle.min.js',
-      'node_modules/ng-toast/dist/ngToast.min.js',
-      'node_modules/angular-sanitize/angular-sanitize.min.js',
-      /* OpenSRF must be installed first */
-      '/openils/lib/javascript/md5.js',
-      '/openils/lib/javascript/JSON_v1.js',
-      '/openils/lib/javascript/opensrf.js',
-      '/openils/lib/javascript/opensrf_ws.js',
-
-      // mock data for testing only
-      'test/data/IDL2js.js',
-      'test/data/eg_mock.js',
-
-      // service/*.js have to be loaded in order
-      'services/grid.js',
-      'services/patron_search.js',
-      'services/user-bucket.js',
-
-      // load app scripts
-      'app.js',
-      'circ/**/*.js',
-      'cat/**/*.js',
-      'reporter/**/*.js',
-      'admin/**/*.js',
-      'test/unit/egIDL.js', // order matters for some of these
-      'test/unit/egOrg.js', 
-      'test/unit/**/*.js'
-    ],
-
-    // test results reporter to use
-    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
-    reporters: ['spec'],  // detailed report
-    //reporters: ['progress'], // summary report
-
-    // enable / disable colors in the output (reporters and logs)
-    colors: true,
-
-    // enable / disable watching file and executing tests whenever any file changes
-    autoWatch : false,
-
-    frameworks: ['jasmine'],
-
-    browsers: ['PhantomJS'],
-
-    // web server port
-    port: 9876,
-
-    /*
-    coverageReporter: {
-      type : 'html',
-      dir : 'coverage/',
-    },
-
-    preprocessors: {
-      '../src/*.js': ['coverage']
-    },
-    */
-
-    // If browser does not capture in given timeout [ms], kill it
-    captureTimeout: 60000,
-
-    // Continuous Integration mode
-    // if true, it capture browsers, run tests and exit
-    singleRun: true
-})}
diff --git a/Open-ILS/web/js/ui/default/staff/test/karma.conf.js.in b/Open-ILS/web/js/ui/default/staff/test/karma.conf.js.in
new file mode 100644 (file)
index 0000000..e57c8f0
--- /dev/null
@@ -0,0 +1,76 @@
+module.exports = function(config){
+    config.set({
+    basePath : '../',
+
+    // config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+    files : [
+      'build/js/vendor.bundle.js',
+      'build/js/core.bundle.js',
+      'node_modules/angular-mocks/angular-mocks.js', // testing only
+      'node_modules/angular-file-saver/dist/angular-file-saver.bundle.min.js',
+      'node_modules/ng-toast/dist/ngToast.min.js',
+      'node_modules/angular-sanitize/angular-sanitize.min.js',
+      /* OpenSRF must be installed first */
+      '@libdir@/javascript/md5.js',
+      '@libdir@/javascript/JSON_v1.js',
+      '@libdir@/javascript/opensrf.js',
+      '@libdir@/javascript/opensrf_ws.js',
+
+      // mock data for testing only
+      'test/data/IDL2js.js',
+      'test/data/eg_mock.js',
+
+      // service/*.js have to be loaded in order
+      'services/grid.js',
+      'services/patron_search.js',
+      'services/user-bucket.js',
+
+      // load app scripts
+      'app.js',
+      'circ/**/*.js',
+      'cat/**/*.js',
+      'reporter/**/*.js',
+      'admin/**/*.js',
+      'test/unit/egIDL.js', // order matters for some of these
+      'test/unit/egOrg.js', 
+      'test/unit/**/*.js'
+    ],
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
+    reporters: ['spec'],  // detailed report
+    //reporters: ['progress'], // summary report
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch : false,
+
+    frameworks: ['jasmine'],
+
+    browsers: ['PhantomJS'],
+
+    // web server port
+    port: 9876,
+
+    /*
+    coverageReporter: {
+      type : 'html',
+      dir : 'coverage/',
+    },
+
+    preprocessors: {
+      '../src/*.js': ['coverage']
+    },
+    */
+
+    // If browser does not capture in given timeout [ms], kill it
+    captureTimeout: 60000,
+
+    // Continuous Integration mode
+    // if true, it capture browsers, run tests and exit
+    singleRun: true
+})}
index d9443a3..59a58b6 100644 (file)
@@ -115,6 +115,23 @@ make -f Open-ILS/src/extras/Makefile.install <osname>-translator
 make -f Open-ILS/src/extras/Makefile.install <osname>-packager
 ------------------------------------------------------------------------------
 
+Configuration and compilation instructions
+------------------------------------------
+
+For the time being, we are still installing everything in the `/openils/`
+directory. From the Evergreen source directory, issue the following commands as
+the *user* Linux account to configure and build Evergreen:
+
+[source, bash]
+------------------------------------------------------------------------------
+PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
+make
+------------------------------------------------------------------------------
+
+These instructions assume that you have also installed OpenSRF under `/openils/`.
+If not, please adjust PATH as needed so that the Evergreen `configure` script
+can find `osrf_config`.
+
 Extra steps for web staff client
 --------------------------------
 
@@ -192,23 +209,6 @@ ng build --prod
 npm run test
 ------------------------------------------------------------------------------
 
-Configuration and compilation instructions
-------------------------------------------
-
-For the time being, we are still installing everything in the `/openils/`
-directory. From the Evergreen source directory, issue the following commands as
-the *user* Linux account to configure and build Evergreen:
-
-[source, bash]
-------------------------------------------------------------------------------
-PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
-make
-------------------------------------------------------------------------------
-
-These instructions assume that you have also installed OpenSRF under `/openils/`.
-If not, please adjust PATH as needed so that the Evergreen `configure` script
-can find `osrf_config`.
-
 Installation instructions
 -------------------------