-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* GPII-3053: GPII-3053: Updating dependencies. GPII-3053: Updated dependencies GPII-3053: Fixing testing up so that it works on Windows. GPII-3053: Updated dependencies. Linting. GPII-3053: Added default task GPII-3053: Adding captionsEnactor tests to all-tests.html Updated to latest gpii-testem and fixed coverage reporting. GPII-3053: Adding a build step to the pre-test. GPII-3503: tests running, but coverage reports not working properly. GPII-3053: Further work to combine node and browser test coverage/report GPII-3053: In progress work to add testem workflow. GPII-3053: adding nyc_output to gitignore GPII-3053: Using infusion-all.js for tests. GPII-3053: Beginning to add testem test infrastructure. GPII-3053: Fixed tests to work with latest sinon-chrome.
- Loading branch information
Showing
19 changed files
with
235 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": "eslint-config-fluid" | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": "eslint-config-fluid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,9 @@ | |
*.crx | ||
package-lock.json | ||
/node_modules/ | ||
/.vagrant/ | ||
report.tap | ||
coverage | ||
reports | ||
instrumented | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
require 'yaml' | ||
|
||
ansible_vars = YAML.load_file("provisioning/vars.yml") | ||
|
||
app_name = ansible_vars["nodejs_app_name"] | ||
|
||
app_directory = ansible_vars["nodejs_app_install_dir"] | ||
|
||
app_start_script = ansible_vars["nodejs_app_start_script"] | ||
|
||
# Check for the existence of the 'VM_HOST_TCP_PORT' environment variable. If it | ||
# doesn't exist and 'nodejs_app_tcp_port' is defined in vars.yml then use that | ||
# port. Failing that use defaults provided in this file. | ||
host_tcp_port = ENV["VM_HOST_TCP_PORT"] || ansible_vars["nodejs_app_tcp_port"] || 8081 | ||
guest_tcp_port = ansible_vars["nodejs_app_tcp_port"] || 8081 | ||
|
||
# By default this VM will use 2 processor cores and 2GB of RAM. The 'VM_CPUS' and | ||
# "VM_RAM" environment variables can be used to change that behaviour. | ||
cpus = ENV["VM_CPUS"] || 2 | ||
ram = ENV["VM_RAM"] || 2048 | ||
|
||
Vagrant.configure(2) do |config| | ||
|
||
config.vm.box = "inclusivedesign/fedora27" | ||
|
||
# Your working directory will be synced to /home/vagrant/sync in the VM. | ||
config.vm.synced_folder ".", "#{app_directory}" | ||
|
||
# Mounts node_modules in /var/tmp to work around issues in the VirtualBox shared folders | ||
config.vm.provision "shell", run: "always", inline: <<-SHELL | ||
sudo mkdir -p /var/tmp/#{app_name}/node_modules #{app_directory}/node_modules | ||
sudo chown vagrant:vagrant -R /var/tmp/#{app_name}/node_modules #{app_directory}/node_modules | ||
sudo mount -o bind /var/tmp/#{app_name}/node_modules #{app_directory}/node_modules | ||
SHELL | ||
|
||
# List additional directories to sync to the VM in your "Vagrantfile.local" file | ||
# using the following format: | ||
# config.vm.synced_folder "../path/on/your/host/os/your-project", "/home/vagrant/sync/your-project" | ||
|
||
if File.exist? "Vagrantfile.local" | ||
instance_eval File.read("Vagrantfile.local"), "Vagrantfile.local" | ||
end | ||
|
||
# Port forwarding takes place here. The 'guest' port is used inside the VM | ||
# whereas the 'host' port is used by your host operating system. | ||
config.vm.network "forwarded_port", guest: guest_tcp_port, host: host_tcp_port, protocol: "tcp", | ||
auto_correct: true | ||
|
||
config.vm.hostname = app_name | ||
|
||
config.vm.provider :virtualbox do |vm| | ||
vm.customize ["modifyvm", :id, "--memory", ram] | ||
vm.customize ["modifyvm", :id, "--cpus", cpus] | ||
vm.customize ["modifyvm", :id, "--vram", "256"] | ||
vm.customize ["modifyvm", :id, "--accelerate3d", "off"] | ||
vm.customize ["modifyvm", :id, "--audio", "null", "--audiocontroller", "ac97"] | ||
vm.customize ["modifyvm", :id, "--ioapic", "on"] | ||
vm.customize ["setextradata", "global", "GUI/SuppressMessages", "all"] | ||
end | ||
|
||
config.vm.provision "shell", inline: <<-SHELL | ||
sudo dnf -y upgrade firefox google-chrome-stable | ||
sudo ansible-galaxy install -fr /home/vagrant/sync/provisioning/requirements.yml | ||
sudo PYTHONUNBUFFERED=1 ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook /home/vagrant/sync/provisioning/playbook.yml --tags="install,configure" --inventory="localhost ansible_connection=local," | ||
SHELL | ||
|
||
# Using config.vm.hostname to set the hostname on Fedora VMs seems to remove the string | ||
# "localhost" from the first line of /etc/hosts. This script reinserts it if it's missing. | ||
# https://github.com/mitchellh/vagrant/pull/6203 | ||
config.vm.provision "shell", | ||
inline: "/usr/local/bin/edit-hosts.sh", | ||
run: "always" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
As this is a browser component, this file is only meant to make it easier to refer to our code and fixtures using | ||
the standard `%package-name/path/to/content` notation. | ||
*/ | ||
/* eslint-env node */ | ||
"use strict"; | ||
var fluid = require("infusion"); | ||
fluid.module.register("ui-options-chrome", __dirname, require); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- hosts: localhost | ||
user: root | ||
|
||
vars_files: | ||
- vars.yml | ||
|
||
roles: | ||
- facts | ||
- nodejs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- src: https://github.com/idi-ops/ansible-facts | ||
name: facts | ||
|
||
- src: https://github.com/idi-ops/ansible-nodejs | ||
name: nodejs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
# Please refer to https://github.com/idi-ops/ansible-nodejs/blob/master/defaults/main.yml | ||
# for documentation related to these variables | ||
|
||
nodejs_app_name: uioPlus | ||
|
||
nodejs_branch: lts | ||
|
||
nodejs_npm_version: 3.10.10 | ||
|
||
nodejs_app_npm_packages: | ||
- testem | ||
- istanbul | ||
|
||
nodejs_app_commands: | ||
- npm install | ||
- grunt | ||
|
||
nodejs_app_install_dir: /home/vagrant/sync | ||
|
||
nodejs_app_git_clone: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"use strict"; | ||
var fluid = require("infusion"); | ||
fluid.setLogging(true); | ||
|
||
fluid.require("%ui-options-chrome"); | ||
require("gpii-testem"); | ||
|
||
fluid.defaults("fluid.tests.testem", { | ||
gradeNames: ["gpii.testem.instrumentation"], | ||
coverageDir: "%ui-options-chrome/coverage", | ||
reportsDir: "%ui-options-chrome/reports", | ||
testPages: ["tests/browser/all-tests.html"], | ||
instrumentedSourceDir: "%ui-options-chrome/instrumented", | ||
instrumentationOptions: { | ||
nonSources: [ | ||
"./**/*.!(js)", | ||
"./Gruntfile.js" | ||
] | ||
}, | ||
sourceDirs: { | ||
extension: "%ui-options-chrome/extension" | ||
}, | ||
contentDirs: { | ||
tests: "%ui-options-chrome/tests" | ||
}, | ||
testemOptions: { | ||
skip: "PhantomJS,Opera,Safari,Firefox,IE", | ||
disable_watching: true, | ||
tap_quiet_logs: true | ||
} | ||
}); | ||
|
||
module.exports = fluid.tests.testem().getTestemOptions(); |