Skip to content

Commit

Permalink
Merge pull request #1165 from bryceosterhaus/sennaDocs
Browse files Browse the repository at this point in the history
chore(senna): add test for senna CI
  • Loading branch information
bryceosterhaus authored Aug 24, 2023
2 parents 3776307 + f92021a commit dcda705
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

env:
CI: true
yarn-cache-name: yarn-cache-20
yarn-cache-name: yarn-cache-21
yarn-cache-path: .yarn

jobs:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/senna.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
Expand All @@ -51,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
Expand All @@ -63,3 +63,5 @@ jobs:
working-directory: maintenance/projects/senna
- run: yarn --cache-folder=../../../${{ env.yarn-cache-path }} build
working-directory: maintenance/projects/senna
- run: yarn --cache-folder=../../../${{ env.yarn-cache-path }} test
working-directory: maintenance/projects/senna
27 changes: 8 additions & 19 deletions maintenance/projects/senna/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,24 @@ organized, as well as contribution requirements.

## Setup

1. Install NodeJS >= [v0.12.0](http://nodejs.org/dist/v0.12.0/), if you don't have it yet.
1. Install NodeJS >= [v10.15.3](http://nodejs.org/dist/v10.15.3/), if you don't have it yet.

2. Install global dependencies:
2. Install local dependencies:

```
[sudo] npm install -g gulp
yarn install
```

3. Install local dependencies:
3. Build the code:

```
npm install
bower install
yarn build
```

4. Build the code:
4. Test the code:

```
gulp
```

5. Test the code:

```
gulp test
```

```
gulp test:coverage
yarn test
```

## Pull requests & Github issues
Expand All @@ -49,7 +38,7 @@ a test, and all tests from the repo need to be passing. To run the tests you
can use our npm script:

```
gulp test
yarn test
```

This will run the complete test suite on Chrome. For a full test pass, you can
Expand Down
17 changes: 17 additions & 0 deletions maintenance/projects/senna/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

const metalKarmaConfig = require('metal-karma-config');

process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
config.set({
browserDisconnectTimeout: 3000,
Expand All @@ -14,6 +16,21 @@ module.exports = function (config) {
timeout: 35000,
},
},
customLaunchers: {
Puppeteer: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--single-process',
],
},
},
});

metalKarmaConfig(config);

config.set({
browsers: ['Puppeteer'],
});
};
2 changes: 2 additions & 0 deletions maintenance/projects/senna/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"gulp-template": "^4.0.0",
"metal-karma-config": "^2.3.1",
"metal-tools-build-rollup": "^2.0.6",
"puppeteer": "2.1.1",
"run-sequence": "^1.1.5",
"sinon": "1.17.7"
},
Expand Down Expand Up @@ -55,6 +56,7 @@
"url": "https://github.com/liferay/liferay-frontend-projects.git"
},
"resolutions": {
"karma-chrome-launcher": "3.2.0",
"metal-uri": "2.2.6",
"rollup-stream": "1.23.1"
},
Expand Down
4 changes: 1 addition & 3 deletions maintenance/projects/senna/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ class App extends EventEmitter {
* @return {boolean}
*/
canNavigate(url) {
const uri = url.startsWith('/')
? new URL(url, window.location.origin)
: new URL(url);
const uri = utils.isWebUri(url);

if (!uri) {
return false;
Expand Down
Loading

0 comments on commit dcda705

Please sign in to comment.