Skip to content

Commit 14651f8

Browse files
authored
Merge pull request #514 from evolvedbinary/ci-reference
Ci reference
2 parents 07df0ad + 2c2e723 commit 14651f8

File tree

15 files changed

+492
-428
lines changed

15 files changed

+492
-428
lines changed

.circleci/config.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,22 @@ jobs:
2525
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
2626
- v1-deps-{{ .Branch }}
2727
- v1-deps
28-
# TODO (DP) slim this down
28+
# TODO (DP) slim this down source: https://github.com/cypress-io/cypress-docker-images/blob/ec0962672571ff557bd3654000a0aa5a0a02057b/base/14.7.0/Dockerfile#L11
2929
- run: |
3030
sudo apt-get update
31-
sudo apt-get --yes install fonts-liberation libx11-dev libxkbfile-dev libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xdg-utils xvfb
31+
sudo apt-get --yes install libx11-dev libxkbfile-dev libgtk2.0-0 libgtk-3-0 libgconf-2-4 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb
3232
3333
# - setup_remote_docker:
3434
# version: 20.10.2
35-
# docker_layer_caching: false
36-
- run:
37-
name: get and install chrome
38-
command: |
39-
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
40-
sudo dpkg -i google-chrome-stable_current_amd64.deb
35+
# docker_layer_caching: false
36+
37+
# (DP) only activate on CI if absolutely necessary. Electron browser tests are our gold standard
38+
# - run:
39+
# name: get and install chrome
40+
# command: |
41+
# sudo apt-get --yes install fonts-liberation xdg-utils
42+
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
43+
# sudo dpkg -i google-chrome-stable_current_amd64.deb
4144
- run:
4245
name: install dockerize
4346
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
@@ -72,8 +75,8 @@ jobs:
7275
curl -v --connect-timeout 4 --max-time 8 http://localhost:3000
7376
- run:
7477
working_directory: .
75-
# command: npx cypress run --config defaultCommandTimeout=58000
76-
command: npx cypress run -b chrome
78+
command: npx cypress run --config defaultCommandTimeout=20000
79+
# command: npx cypress run -b chrome --config defaultCommandTimeout=58000
7780
no_output_timeout: 2m
7881
workflows:
7982
browser_build:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ lib
6868
# ide apps
6969
*-app/*
7070
!*-app/package.json
71+
!*-app/webpack.config.js
7172
fusion-studio-extension/src/browser/style/index.css
7273

7374
# integration test files
@@ -80,3 +81,7 @@ cypress/screenshots/*
8081
# node-gyp
8182
build/
8283
fusion-studio-extension/src/variables.ts
84+
85+
# Expath
86+
*.xar
87+
autodeploy/

browser-app/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
"version": "1.1.0",
55
"dependencies": {
66
"@theia/core": "^1.15.0",
7+
"@theia/editor": "^1.15.0",
78
"@theia/filesystem": "^1.15.0",
8-
"@theia/workspace": "^1.15.0",
9-
"@theia/preferences": "^1.15.0",
9+
"@theia/markers": "^1.15.0",
10+
"@theia/messages": "^1.15.0",
11+
"@theia/monaco": "^1.15.0",
1012
"@theia/navigator": "^1.15.0",
13+
"@theia/preferences": "^1.15.0",
1114
"@theia/process": "^1.15.0",
1215
"@theia/terminal": "^1.15.0",
13-
"@theia/editor": "^1.15.0",
14-
"@theia/markers": "^1.15.0",
15-
"@theia/monaco": "^1.15.0",
16-
"@theia/messages": "^1.15.0",
17-
"fusion-studio-extension": "1.2.0"
16+
"@theia/workspace": "^1.15.0",
17+
"fusion-studio-extension": "1.2.0",
18+
"process": "^0.11.10"
1819
},
1920
"devDependencies": {
2021
"@theia/cli": "^1.15.0"
@@ -32,4 +33,4 @@
3233
}
3334
}
3435
}
35-
}
36+
}

browser-app/webpack.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This file can be edited to customize webpack configuration.
3+
* To reset delete this file and rerun theia build again.
4+
*/
5+
const webpack = require('webpack');
6+
const config = require('./gen-webpack.config.js');
7+
const yargs = require('yargs');
8+
9+
if (yargs.option('mode').argv.mode === 'development') {
10+
console.log('Development mode. Including process variable...');
11+
config.plugins.push(new webpack.ProvidePlugin({ process: require.resolve('process/browser') }));
12+
}
13+
module.exports = config;

cypress/integration/01_api-spec.js

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,66 @@
22

33
context('Talking to the api directly', () => {
44
describe('API version', () => {
5-
before(function() {
6-
cy.connect();
7-
cy.visit('/');
8-
});
9-
it('should fail to connect with older api', () => {
10-
cy.intercept('GET', Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version', { fixture: 'bad_api' });
11-
cy.get('.fusion-item').click().then(() => {
12-
cy.get('.dialogTitle').should('contain.text', 'New Connection');
13-
cy.get('.dialogContent').should('be.visible')
14-
.should('contain.text', 'Outdated API "0.0.1"')
15-
.should('contain.text', 'You need to update your API to version "0.2.0" or higher');
16-
cy.get('.theia-button.main').should('be.visible').click();
17-
cy.get('.dialogBlock').should('not.exist');
18-
});
19-
});
20-
it('should connect with newer api', () => {
21-
cy.window().then(function(win) {
22-
const fetchSpy = cy.spy(win, 'fetch');
23-
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version').as('/version');
24-
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/explorer?uri=/').as('/explorer');
25-
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/user').as('/user');
26-
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/group').as('/group');
27-
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/index').as('/index');
28-
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/restxq').as('/restxq');
29-
cy.get('.fusion-item').click();
5+
before(function () {
6+
cy.connect()
7+
cy.visit('/')
8+
})
9+
describe('With outdated API', () => {
10+
it('should fail to connect with older api', () => {
11+
cy.intercept('GET', Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version', { fixture: 'bad_api' })
12+
cy.get('.fusion-item').click().then(() => {
13+
cy.get('.dialogTitle').should('contain.text', 'New Connection')
14+
cy.get('.dialogContent').should('be.visible')
15+
.should('contain.text', 'Outdated API "0.0.1"')
16+
.should('contain.text', 'You need to update your API to version "0.2.0" or higher')
17+
cy.get('.theia-button.main').should('be.visible').click()
18+
cy.get('.dialogBlock').should('not.exist')
19+
})
20+
})
21+
})
22+
describe('With current API', () => {
23+
it('should reach all api endpoints', () => {
24+
cy.window().then(function (win) {
25+
const fetchSpy = cy.spy(win, 'fetch')
26+
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version').as('/version')
27+
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/explorer?uri=/').as('/explorer')
28+
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/user').as('/user')
29+
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/group').as('/group')
30+
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/index').as('/index')
31+
// See #508
32+
// fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/restxq').as('/restxq')
33+
cy.get('.fusion-item').click()
34+
cy.get('@/version').should('be.called')
35+
cy.get('@/explorer').should('be.called')
36+
cy.get('@/user').should('be.called')
37+
cy.get('@/group').should('be.called')
38+
cy.get('@/index').should('be.called')
39+
// See #508
40+
// cy.get('@/restxq').should('be.called')
41+
})
42+
})
43+
44+
// (DP) we might want to merge the three cases again at a future time
45+
it('should display db tree item', () => {
46+
cy.contains('localhost').click()
3047
cy.get('.fusion-view')
3148
.should('contain', 'db')
32-
.should('contain', 'RestXQ');
33-
cy.get('@/version').should('be.called');
34-
cy.get('@/explorer').should('be.called');
35-
cy.get('@/user').should('be.called');
36-
cy.get('@/group').should('be.called');
37-
cy.get('@/index').should('be.called');
38-
cy.get('@/restxq').should('be.called');
39-
});
40-
});
41-
});
42-
})
49+
// .should('contain', 'Security')
50+
// .should('contain', 'RestXQ')
51+
})
52+
53+
it('should display security tree item', () => {
54+
cy.contains('localhost')
55+
cy.get('.fusion-view')
56+
.should('contain', 'Security')
57+
})
58+
59+
// see #508
60+
it.skip('should display restxq tree item', () => {
61+
cy.contains('localhost')
62+
cy.get('.fusion-view')
63+
.should('contain', 'RestXQ')
64+
})
65+
})
66+
})
67+
})

cypress/integration/02_eval_spec.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ context('Evaluation', () => {
1010
describe('The Theia Panel', () => {
1111
it('should be accessible from command panel', () => {
1212
// invoke command panel and run the command
13-
cy.get('body').trigger('keydown', { keyCode: 112, which: 112 })
14-
.trigger('keyup', { keyCode: 112, which: 112 })
15-
cy.get('.quick-open-overlay .quick-open-input input')
13+
if (Cypress.platform === 'darwin') {
14+
cy.get('body')
15+
.type('{shift+meta+P}')
16+
} else {
17+
cy.get('body')
18+
.type('{shift+ctrl+P}')
19+
}
20+
cy.get('input.input')
1621
.clear()
1722
.type('>Toggle Evaluation View{enter}')
1823
// check the panel
@@ -43,7 +48,7 @@ context('Evaluation', () => {
4348
.contains('file')
4449
.click()
4550
})
46-
51+
4752
it('should have proper header and footer', () => {
4853
cy.get('.x-header > button')
4954
.should('be.disabled')
@@ -54,13 +59,13 @@ context('Evaluation', () => {
5459
.should('be.disabled')
5560
.should('contain', 'New file')
5661
})
57-
62+
5863
it('should disappear again', () => {
5964
// invoke command panel and run the command again
6065
cy.get('body')
6166
.trigger('keydown', { keyCode: 112, which: 112 })
6267
.trigger('keyup', { keyCode: 112, which: 112 })
63-
cy.get('.quick-open-overlay .quick-open-input input')
68+
cy.get('input.input')
6469
.clear()
6570
.type('>Toggle Evaluation View{enter}')
6671
// check the panel

cypress/integration/03_connection_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ context('Connecting to Servers', () => {
3131
.then(() => {
3232
cy.get('.ReactVirtualized__Grid__innerScrollContainer')
3333
.should('contain', 'db')
34-
.should('contain', 'RestXQ')
34+
// see #508
35+
// .should('contain', 'RestXQ')
3536
})
3637
})
3738

cypress/integration/04_document_spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="Cypress" />
22

3-
context('Document Operations', () => {
3+
context.skip('Document Operations', () => {
44
describe('working with tree view', () => {
55
before(() => {
66
cy.connect()
@@ -28,7 +28,9 @@ context('Document Operations', () => {
2828
.should('be.visible')
2929
.click()
3030
})
31-
// (DP): start workaround for #413
31+
// (DP): start workaround for #413
32+
cy.get('.fusion-item')
33+
.click()
3234
cy.get('[node-id$=db]')
3335
.trigger('mousemove')
3436
.type('{enter}')

cypress/integration/05_collection_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="Cypress" />
22

3-
context('Collection Operations', () => {
3+
context.skip('Collection Operations', () => {
44
let fetchSpy;
55
describe('working with tree view', () => {
66
before(() => {

cypress/integration/06_permission_spec.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,24 @@ context('Permission Manager', () => {
88
.click()
99
})
1010

11+
// (DP)) we need frequent assertions to work around the fact that the tree collapes on new requests
12+
// see #513 #397
1113
it('should have user entries', () => {
1214
cy.get('[node-id$=security]')
13-
.click()
14-
cy.get('.ReactVirtualized__Grid')
15-
.contains('Users')
16-
.click()
17-
cy.get('[node-id$=user\\/guest]')
1815
.should('be.visible')
16+
.click()
17+
.then(() => {
18+
cy.get('[node-id$=security\\/user]')
19+
.should('be.visible')
20+
.click()
21+
.then(() => {
22+
cy.get(`[node-id=${CSS.escape('admin@' + Cypress.env('API_HOST'))}]`)
23+
.should('be.visible')
24+
.click()
25+
cy.get('[node-id$=user\\/guest]')
26+
.should('be.visible')
27+
})
28+
})
1929
})
2030

2131
it('should have group entries', () => {
@@ -30,6 +40,7 @@ context('Permission Manager', () => {
3040
describe('the user item', () => {
3141
it('should let us create a new user', () => {
3242
cy.get('[node-id$=security]')
43+
.should('be.visible')
3344
.rightclick()
3445
cy.get('[data-command="fusion.add-user"]')
3546
.contains('Add')
@@ -53,6 +64,7 @@ context('Permission Manager', () => {
5364

5465
it('should display user properties card', () => {
5566
cy.get('[node-id$=user\\/guest]')
67+
.should('be.visible')
5668
.rightclick()
5769
cy.get('.p-Menu > ul > .p-Menu-item')
5870
.should('be.visible')
@@ -79,6 +91,7 @@ context('Permission Manager', () => {
7991

8092
it('should let us delete a user', () => {
8193
cy.get('[node-id$=user\\/cy-usr]')
94+
.should('be.visible')
8295
.rightclick()
8396
cy.get('[data-command="fusion.delete-user"]')
8497
.click()
@@ -94,6 +107,7 @@ context('Permission Manager', () => {
94107
describe('the groups item', () => {
95108
it('should let us create a new group', () => {
96109
cy.get('[node-id$=security]')
110+
.should('be.visible')
97111
.rightclick()
98112
cy.get('[data-command="fusion.add-group"]')
99113
.contains('Add')
@@ -107,6 +121,7 @@ context('Permission Manager', () => {
107121

108122
it('should display group properties card', () => {
109123
cy.get('[node-id$=group\\/guest]')
124+
.should('be.visible')
110125
.rightclick()
111126
cy.get('.p-Menu > ul > .p-Menu-item')
112127
.should('be.visible')
@@ -129,6 +144,7 @@ context('Permission Manager', () => {
129144

130145
it('should let us delete a group', () => {
131146
cy.get('[node-id$=group\\/cy-group]')
147+
.should('be.visible')
132148
.rightclick()
133149
cy.get('[data-command="fusion.delete-group"]')
134150
.click()

0 commit comments

Comments
 (0)