Skip to content

Commit

Permalink
Merge branch 'broadcasting' into authoring-react-post-broadcasting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Sep 11, 2023
2 parents f2d5cf1 + b3f054b commit 34863b1
Show file tree
Hide file tree
Showing 25 changed files with 334 additions and 139 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ jobs:
with:
name: screenshots-e2e-${{ matrix.suite }}
path: /tmp/*.png

- name: Server Logs
if: ${{ failure() }}
run: docker-compose logs superdesk
working-directory: e2e/server
2 changes: 1 addition & 1 deletion e2e/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"jasmine-reporters": "2.3.0",
"protractor": "7.0.0",
"typescript": "4.9.3",
"webdriver-manager": "^12.1.8"
"webdriver-manager": "^12.1.9"
},
"scripts": {
"build": "npx @superdesk/build-tools build-root-repo ./",
Expand Down
12 changes: 12 additions & 0 deletions e2e/client/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable comma-dangle */

var path = require('path');
const execSync = require('child_process').execSync;

function getChromeOptions() {
var chromeOptions = {
Expand Down Expand Up @@ -55,6 +56,16 @@ var config = {
chromeDriver: process.env.CHROMEWEBDRIVER ? (process.env.CHROMEWEBDRIVER + '/chromedriver') : null,

onPrepare: function() {
execSync(
`
echo "chrome version:" && $CHROME_BIN --version
echo "\n"
echo "webdriver-manager version:" && npx webdriver-manager version
echo "\n"
`,
{stdio: 'inherit'},
);

require('./specs/helpers/setup').setup({fixture_profile: 'app_prepopulate_data'});

// so it can be used without import in tests
Expand All @@ -73,6 +84,7 @@ var config = {
this.specDone = function(result) {
if (result.failedExpectations.length > 0) {
browser.screenshot(result.fullName.replace(/[^\w]+/g, '-'));
require('./specs/helpers/utils').printLogs();
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/client/run-end-to-end-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function installWebdriverDriver() {
} catch (_) {
// driver not installed, installing:

const version = execSync('$CHROME_BIN --product-version').toString();;
const version = execSync('$CHROME_BIN --product-version').toString();

if (version == null) {
return reject('To launch the test server a chrome based browser has to be installed and CHROME_BIN environment variable set.');
Expand All @@ -38,7 +38,7 @@ ensurePackageInstalled()
.then(() => {
const argumentsToForward = process.argv.slice(2).join(' ');

return execSync(`npx protractor protractor.conf.js ${argumentsToForward}`, {stdio: 'inherit'});
execSync(`npx protractor protractor.conf.js ${argumentsToForward}`, {stdio: 'inherit'});
})
.catch((e) => {
console.error(e);
Expand Down
7 changes: 3 additions & 4 deletions e2e/client/specs/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ export function printLogs(prefix) {
.then((browserLog) => {
var logs = browserLog.filter((log) => log.level.value >= 1000);

console.info(
(prefix ? prefix + ' ' : '') +
'log: ' + require('util').inspect(logs, {dept: 3}),
);
for (const log of logs) {
console.error(`BROWSER CONSOLE ERROR: ${log.message}`);
}
});
}

Expand Down
1 change: 1 addition & 0 deletions e2e/server/Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rest: PYTHONUNBUFFERED=True gunicorn -c gunicorn_config.py wsgi
wamp: python3 -u ws.py
work: celery -A worker worker
1 change: 1 addition & 0 deletions e2e/server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- e2e
environment:
- discovery.type=single-node
- action.auto_create_index=false
tmpfs:
- /usr/share/elasticsearch/data

Expand Down
4 changes: 2 additions & 2 deletions e2e/server/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import os

DEBUG = bool(os.environ.get('SUPERDESK_DEBUG'))
DEBUG = False
SUPERDESK_TESTING = True

SERVER_NAME = 'localhost:5000'
Expand All @@ -25,6 +25,6 @@
CONTENTAPI_ELASTICSEARCH_INDEX = CONTENTAPI_MONGO_DBNAME

LEGAL_ARCHIVE = True
CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_ALWAYS_EAGER = False

DEFAULT_TIMEZONE = "Europe/London"
Loading

0 comments on commit 34863b1

Please sign in to comment.