Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #479 from aldryn/bugfix/frontend-tests
Browse files Browse the repository at this point in the history
Fixed frontend setup
  • Loading branch information
vxsx committed Jan 24, 2018
2 parents f9161d1 + 2d80ef2 commit c8615c3
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 67 deletions.
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ addons:
packages:
- libenchant-dev

env:
global:
# encrypted Sauce Labs sub-account user name
- secure: RGXS2qmljsyLVGEifz9yvLwdg33KxPDeuwHx0QFmjSkQuJZP92Xxl36qr6rNel52L+39oya8BGD/ddB6RNI6R5TsoOvQGMlrVZmYy4d8EPA7J8u3+Mpp1zQGK1ACmcnVm+5h8dbHeWtZW/1SovnclUYem16KUmQf35l9G9tKc/I=
# encrypted Sauce Labs sub-account token
- secure: Lt1n+6a4hj7BuShOufWfiAF3aTC4B6xpHwwcbklVy+fdy4pkY3okXO9CFtWkOTBRrFrgc8R+PL9dZ6ObK3SE1w7LU3dur89uIvJ4RXQ1uROr40PXAxD8RO+/2wp7nhh6CmG7GEKpuKt5QHbgdFVrJtmyoPp4vco1pU86njtEico=
# encrypted Code Climate token
- secure: Jq2JBTBMYLpnrwk6uuAWGOX4y+TEVkBuwSZywSrlKb9sW77DloxRfGXH81Q9juvaAy4KqtcGY6HE5vqJSo77MS/cmbtmZe4ypPKgVFy2YDDUGdLi65vEjkerjAmtS7bYBVur+fWG0mpYAmnfj06d0MgkBgwgCr4yLbJFtW8ElAM=
matrix:
include:
- python: '3.5'
Expand Down Expand Up @@ -79,9 +71,8 @@ install:
- pip install coveralls

before_script:
- if [ "$FE" == 1 ]; then nvm install 0.12.7 && nvm use 0.12.7; fi
- if [ "$FE" == 1 ]; then nvm install 6 && nvm use 6; fi
- if [ "$FE" == 1 ]; then npm config set spin false; fi
- if [ "$FE" == 1 ]; then npm install -g npm@2; fi
- if [ "$FE" == 1 ]; then npm install -g gulp@3.9.0; fi
- if [ "$FE" == 1 ]; then npm install -g codeclimate-test-reporter; fi
- if [ "$FE" == 1 ]; then npm install; fi
Expand Down
3 changes: 1 addition & 2 deletions aldryn_newsblog/cms_wizards.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from __future__ import unicode_literals

from django import forms
from django.db import transaction
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.translation import ugettext_lazy as _

from cms.api import add_plugin
from cms.utils import permissions
Expand Down
2 changes: 1 addition & 1 deletion aldryn_newsblog/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from cms.appresolver import clear_app_resolvers
from cms.exceptions import AppAlreadyRegistered
from cms.test_utils.testcases import CMSTestCase, TransactionCMSTestCase
from cms.utils import get_cms_setting
from cms.utils.conf import get_cms_setting

from cms.toolbar.toolbar import CMSToolbar

Expand Down
25 changes: 0 additions & 25 deletions aldryn_newsblog/tests/frontend/base.conf.js

This file was deleted.

22 changes: 1 addition & 21 deletions aldryn_newsblog/tests/frontend/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,11 @@

// #############################################################################
// CONFIGURATION
var baseConf = require('./base.conf');

module.exports = function (config) {
var browsers = {
PhantomJS: 'used for local testing'
};

// Browsers to run on Sauce Labs
// Check out https://saucelabs.com/platforms for all browser/OS combos
if (process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY) {
browsers = baseConf.sauceLabsBrowsers.reduce(function (newBrowsers, capability) {
newBrowsers[JSON.stringify(capability)] = capability;
newBrowsers[JSON.stringify(capability)].base = 'SauceLabs';
return newBrowsers;
}, {});
}

var settings = {
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '..',
Expand Down Expand Up @@ -78,7 +66,7 @@ module.exports = function (config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage', 'saucelabs'],
reporters: ['progress', 'coverage'],

// web server port
port: 9876,
Expand All @@ -103,13 +91,5 @@ module.exports = function (config) {
singleRun: false
};

if (process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY) {
settings.sauceLabs = {
testName: baseConf.formatTaskName('Unit')
};
settings.captureTimeout = 240000;
settings.customLaunchers = browsers;
}

config.set(settings);
};
2 changes: 1 addition & 1 deletion aldryn_newsblog/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ class MyClass():
default_reverse(non_pattern, default=default),
default
)
except:
except: # noqa: E722
self.fail('default_reverse raised exception even though we '
'set a default value of: {0}.'.format(default))
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except:
except: # noqa: E722
html_theme = 'default'

# The theme to use for HTML and HTML Help pages. Major themes that come with
Expand Down
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var gutil = require('gulp-util');
var KarmaServer = require('karma').Server;
var eslint = require('gulp-eslint');
var integrationTests = require('djangocms-casper-helpers/gulp');
var path = require('path');
var child_process = require('child_process');

var argv = require('minimist')(process.argv.slice(2)); // eslint-disable-line

Expand Down Expand Up @@ -65,13 +67,18 @@ gulp.task('tests:unit', function (done) {
});

// gulp tests:integration [--clean] [--screenshots] [--tests=loginAdmin,toolbar]
var pathToBin = child_process.execSync('npm bin').toString().trim();
var pathToCasper = path.join(pathToBin, 'casperjs');

gulp.task('tests:integration', integrationTests({
tests: INTEGRATION_TESTS,
pathToTests: PROJECT_PATH.tests,
argv: argv,
dbPath: 'local.sqlite',
serverCommand: 'test_settings.py server',
logger: gutil.log.bind(gutil)
logger: gutil.log.bind(gutil),
waitForMigrations: 120,
pathToCasper: pathToCasper
}));


Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"name": "package",
"private": true,
"devDependencies": {
"browserslist-saucelabs": "^0.1.4",
"djangocms-casper-helpers": "^1.1.0",
"djangocms-casper-helpers": "^1.4.0",
"gulp": "3.9.0",
"gulp-eslint": "^2.0.0",
"gulp-util": "3.0.6",
Expand All @@ -16,7 +15,6 @@
"karma-jasmine": "^0.3.6",
"karma-json-fixtures-preprocessor": "0.0.4",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sauce-launcher": "0.2.14",
"minimist": "1.1.1",
"phantomjs-prebuilt": "^2.1.7"
}
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ envlist =
passenv =
CI
HOME
SAUCE_ACCESS_KEY
SAUCE_USERNAME
TRAVIS_BUILD_NUMBER
TRAVIS_PULL_REQUEST
TRAVIS_REPO_SLUG
Expand Down

0 comments on commit c8615c3

Please sign in to comment.