Skip to content

Commit

Permalink
Bump test dependencies, install web acceptance test deps in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Feb 24, 2022
1 parent 597b186 commit 96d901d
Show file tree
Hide file tree
Showing 8 changed files with 2,617 additions and 1,008 deletions.
10 changes: 4 additions & 6 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -382,23 +382,20 @@ def UITests(ctx):
"BACKEND_HOST": "https://ocis-server:9200",
"RUN_ON_OCIS": "true",
"OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/storage/owncloud/",
"OCIS_SKELETON_DIR": "/srv/app/testing/data/webUISkeleton",
"TESTING_DATA_DIR": "/srv/app/testing/data",
"WEB_UI_CONFIG": "/drone/src/ui/tests/config/drone/web-config.json",
"TEST_TAGS": "not @skipOnOCIS and not @skip",
"LOCAL_UPLOAD_DIR": "/uploads",
"NODE_TLS_REJECT_UNAUTHORIZED": 0,
"WEB_PATH": "/srv/app/web",
"FEATURE_PATH": "/drone/src/ui/tests/acceptance/features",
"MIDDLEWARE_HOST": "http://middleware:3000",
},
"commands": [
". /drone/src/.drone.env",
"git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/testing",
"git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web",
"cd /srv/app/web",
"git checkout $WEB_COMMITID",
"cd /drone/src/",
"yarn install --all",
"yarn install --frozen-lockfile",
"make test-acceptance-webui",
],
"volumes": [
Expand Down Expand Up @@ -431,9 +428,10 @@ def UITests(ctx):

def middlewareService():
environment = {
"BACKEND_HOST": "https://ocis:9200",
"BACKEND_HOST": "https://ocis-server:9200",
"OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/storage/owncloud/",
"RUN_ON_OCIS": "true",
"HOST": "middleware",
"REMOTE_UPLOAD_DIR": "/uploads",
"NODE_TLS_REJECT_UNAUTHORIZED": "0",
"MIDDLEWARE_HOST": "middleware",
Expand Down
1 change: 0 additions & 1 deletion docs/extensions/hello/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Now we can run the tests. The tests will take several configuration variables wh

``` bash
export WEB_PATH=<path to ownCloud Web directory>
export OCIS_SKELETON_DIR=<path to the skeleton directory>
export WEB_UI_CONFIG=<path to the config.json file used by web>
```

Expand Down
13 changes: 4 additions & 9 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
const path = require('path')
const WEB_PATH = process.env.WEB_PATH
const TEST_INFRA_DIRECTORY = process.env.TEST_INFRA_DIRECTORY

const config = require(path.join(WEB_PATH, 'nightwatch.conf.js'))
const config = require(path.join(TEST_INFRA_DIRECTORY, 'nightwatch.conf.js'))

config.page_objects_path = [TEST_INFRA_DIRECTORY + '/acceptance/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = TEST_INFRA_DIRECTORY + '/acceptance/customCommands'
config.page_objects_path = [TEST_INFRA_DIRECTORY + '/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = TEST_INFRA_DIRECTORY + '/customCommands'

config.test_settings.default.globals = { ...config.test_settings.default.globals }

module.exports = {
...config
}
module.exports = config
83 changes: 44 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,85 @@
{
"private": true,
"name": "ocis-hello",
"version": "0.0.0",
"private": true,
"description": "",
"homepage": "https://github.com/owncloud/ocis-hello#readme",
"license": "Apache-2.0",
"author": "ownCloud GmbH <devops@owncloud.com>",
"repository": "https://github.com/owncloud/ocis-hello.git",
"bugs": {
"url": "https://github.com/owncloud/ocis-hello/issues",
"email": "support@owncloud.com"
},
"repository": "https://github.com/owncloud/ocis-hello.git",
"license": "Apache-2.0",
"author": "ownCloud GmbH <devops@owncloud.com>",
"scripts": {
"lint": "eslint ui/**/*.vue ui/**/*.js --color --global requirejs --global require",
"acceptance-tests": "cucumber-js --require-module @babel/register --require-module @babel/polyfill --require ${TEST_INFRA_DIRECTORY}/setup.js --require ui/tests/acceptance/stepDefinitions --require ${TEST_INFRA_DIRECTORY}/stepDefinitions --format @cucumber/pretty-formatter",
"build": "rollup -c",
"watch": "rollup -c -w",
"test": "echo 'Not implemented'",
"generate-api": "node node_modules/swagger-vue-generator/bin/generate-api.js --package-version v0 --source pkg/proto/v0/hello.swagger.json --moduleName hello --destination ui/client/hello/index.js",
"acceptance-tests": "cucumber-js --require-module @babel/register --require-module @babel/polyfill --require ${TEST_INFRA_DIRECTORY}/acceptance/setup.js --require ui/tests/acceptance/stepDefinitions --require ${TEST_INFRA_DIRECTORY}/acceptance/stepDefinitions --format node_modules/cucumber-pretty -t \"${TEST_TAGS:-not @skip and not @skipOnOC10}\""
"lint": "eslint ui/**/*.vue ui/**/*.js --color --global requirejs --global require",
"test": "echo 'Not implemented'",
"watch": "rollup -c -w"
},
"browserslist": [
"> 1%",
"not dead"
],
"dependencies": {
"axios": "^0.26.0",
"qs": "^6.10.1"
},
"devDependencies": {
"@babel/core": "^7.7.7",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-export-default-from": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.7",
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.8.0",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/polyfill": "^7.10.1",
"@babel/preset-env": "^7.7.7",
"@babel/register": "^7.10.1",
"@babel/preset-env": "^7.13.12",
"@babel/register": "^7.14.5",
"@cucumber/cucumber": "^7.3.1",
"@cucumber/pretty-formatter": "^1.0.0-alpha.1",
"@erquhart/rollup-plugin-node-builtins": "^2.1.5",
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.0.1",
"@rollup/plugin-replace": "^2.3.0",
"archiver": "^4.0.1",
"axios": "^0.21.1",
"core-js": "3",
"cross-env": "^6.0.3",
"cucumber": "^6.0.5",
"cucumber-pretty": ">=6.0.0",
"debounce": "^1.2.0",
"easygettext": "^2.7.0",
"eslint": "6.8.0",
"eslint-config-standard": "^14.1.0",
"archiver": "^5.3.0",
"chromedriver": "^93.0.1",
"cross-env": "^7.0.3",
"easygettext": "^2.17.0",
"eslint": "7.24.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-node": "11.0.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.1.2",
"fs-extra": "^9.0.1",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.8.0",
"fs-extra": "^10.0.0",
"join-path": "^1.1.1",
"ldapjs": "^2.2.3",
"nightwatch": "1.5.1",
"nightwatch-api": "3.0.1",
"nightwatch": "1.7.11",
"nightwatch-api": "3.0.2",
"nightwatch-vrt": "^0.2.10",
"node-fetch": "^2.6.1",
"qs": "^6.9.1",
"qs": "^6.10.1",
"rimraf": "^3.0.0",
"rollup": "^1.28.0",
"rollup": "^2.55.1",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-filesize": "^6.2.1",
"rollup-plugin-filesize": "^9.1.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.3",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "^5.1.4",
"swagger-vue-generator": "^1.0.6",
"url-search-params-polyfill": "^8.1.0",
"vue-template-compiler": "^2.6.11",
"xml-js": "^1.6.11"
},
"browserslist": [
"> 1%",
"not dead"
],
"peerDependencies": {
"owncloud-design-system": "^12.0.0"
},
"engines": {
"node": ">=14 <=16"
}
}
6 changes: 3 additions & 3 deletions pkg/assets/embed.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/tests/acceptance/stepDefinitions/helloContext.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const assert = require('assert')
const { client } = require('nightwatch-api')
const { Given, When, Then } = require('cucumber')
const { Given, When, Then } = require('@cucumber/cucumber')

Given('the user browses to the hello page', function () {
return client.page.helloPage().navigateAndWaitTillLoaded()
Expand Down
13 changes: 3 additions & 10 deletions ui/tests/run-acceptance-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ then
exit 1
fi

if [ -z "$OCIS_SKELETON_DIR" ]
then
echo "OCIS_SKELETON_DIR env variable is not set, cannot find skeleton directory"
exit 1
fi

if [ -z "$WEB_UI_CONFIG" ]
then
echo "WEB_UI_CONFIG env variable is not set, cannot find web config file"
Expand All @@ -29,9 +23,9 @@ trap clean_up SIGHUP SIGINT SIGTERM
if [ -z "$TEST_INFRA_DIRECTORY" ]
then
cleanup=true
testFolder=$(< /dev/urandom LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
testFolder=$(mktemp -d -p .)
printf "creating folder $testFolder for Test infrastructure setup\n\n"
export TEST_INFRA_DIRECTORY=$testFolder
export TEST_INFRA_DIRECTORY=$(realpath $testFolder)
fi

clean_up() {
Expand All @@ -46,12 +40,11 @@ clean_up() {

trap clean_up SIGHUP SIGINT SIGTERM EXIT

cp -r "$WEB_PATH"/tests ./"$testFolder"
cp -r $(ls -d "$WEB_PATH"/tests/acceptance/* | grep -v 'node_modules') "$testFolder"

export SERVER_HOST=${SERVER_HOST:-https://localhost:9200}
export BACKEND_HOST=${BACKEND_HOST:-https://localhost:9200}
export RUN_ON_OCIS='true'
export TEST_TAGS=${TEST_TAGS:-"not @skip"}

yarn run acceptance-tests "$1"

Expand Down
Loading

0 comments on commit 96d901d

Please sign in to comment.