GithubHelp home page GithubHelp logo

pga03 / universal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gpii/universal

0.0 2.0 0.0 5.35 MB

Cross platform, core components of the GPII personalization infrastructure

Home Page: gpii.net

License: Other

JavaScript 98.35% HTML 1.65%

universal's Introduction

GPII Universal

Cross platform, core components of the GPII personalization infrastructure. This repository should not be used directly, but in conjunction with one of the top-level GPII architecture-specific repositories. Documentation for this project is housed beneath http://wiki.gpii.net/w/Architecture .

Installation

This repository should be installed using one of the top-level GPII architecture-specific repositories -

For development purposes this repository could be cloned directly - however, please ensure that it is housed in a directory named node_modules otherwise its test cases will not be able to self-resolve.

Whenever you run npm install for this project, you must always follow by issuing the npm task npm run dedupe-infusion. The reason for this requirement is explained at http://issues.gpii.net/browse/GPII-492 . The standard npm start task will invoke dedupe-infusion automatically.

Quick Start

To verify the basic installation of GPII universal, you can start the core framework with

npm start

If all is well, you will see a message like

01:51:07.289:  Kettle Server 2us8uqry-22 is listening on port 8081

Note that this installation will not include any OS-specific features, but can be used to verify system function with basic preference sets which only start solutions which require filesystem-based configuration (XML, JSON or .INI files).

Testing

There are currently 3 different sets of tests:

  • the ones that run in the browser
  • the ones run in node.js
  • production tests, running in node.js but having external requirements

Running browser tests:

open {universal}/tests/web/html/all-tests.html in your preferred browser

Running node-based tests

From the root of the universal folder, run the following command:

npm test

Running tests using a VM

A VM can be automatically created using tools provided by the Prosperity4All Quality Infrastructure. Please ensure the requirements have been met. The vagrant up command can then be used to provision a new VM.

Following provisioning, tests can be run in the VM from the host system as follows:

  • node-based tests: vagrant ssh -c 'cd /home/vagrant/sync/node_modules/universal && npm test'
  • browser-based tests: vagrant ssh -c 'cd /home/vagrant/sync/node_modules/universal && DISPLAY=:0 testem ci --file tests/web/testem_qi.json'
  • production tests: vagrant ssh -c 'cd /home/vagrant/sync/node_modules/universal && node tests/ProductionConfigTests.js'

Usage

To use any of the gpii components or functionality in node.js, use the following statements to get access to fluid and/or gpii objects.

var fluid = require("universal"),
    gpii = fluid.registerNamespace("gpii");
// Now you will have access to both fluid and gpii namespaces.

Running node-based production tests

The purpose of these tests are to test production config setups of the system. This involves using the online preferences server when fetching preferences sets, so there are extended requirements for these tests.

These tests are a supplement to the all-tests.js (and hence not part of that test suite) and should be run separately when testing the system and having the below requirements available.

Requirements:

  • an internet connection
  • a preferences server running at http://preferences.gpii.net containing at least the following (unmodified) NP set: MikelVargas

The tests are run using the following command:

node tests/ProductionConfigTests.js

Building Docker Images

The Dockerfile can be used to build a containerized version of GPII Universal, at this time primarily for use by downstream containers running components such the Preferences Server and Flow Manager in standalone cloud configuration.

The following command can be used to build an image locally as long as it is run relative to the repository's Dockerfile:

docker build --rm -t gpii/universal:$(git rev-parse --short HEAD) .

That will use the Git repository's current abbreviated commit hash as a Docker tag. If you would like to download the latest public Universal image you can use this command:

docker pull gpii/universal

Or use the following command to download a particular image identified using a Git commit hash:

docker pull gpii/universal:<first seven characters of a git commit hash>

Additional notes:

  • The Docker image is built within the container using the same Ansible role used to provision VMs, to simplify the management of different environments.
  • Universal is installed to /opt/gpii/node_modules/universal to allow the node-based test cases to resolve. Regarding the tests:
    • Currently, the node-based tests are always run when this container is built. If you would like to turn this off for local debugging or faster building, remove the npm test item in the nodejs_app_commands list in provisioning/docker-vars.yml

universal's People

Contributors

yzen avatar amb26 avatar javihernandez avatar kaspermarkus avatar simonbates avatar jobara avatar colinbdclark avatar cindyli avatar cstrobbe avatar sgithens avatar stevealee avatar waharnum avatar klown avatar svelichkova avatar avtar avatar claudialoitsch avatar ipeinado avatar thanos21 avatar chfr avatar giron3s avatar michelled avatar taxiarchis avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.