summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-03-15 16:40:53 +0100
committerOskar Nyberg <oskar@mullvad.net>2021-03-15 16:40:53 +0100
commitd60ccf829a9d2c5d8ddf7e549e72c8d31a090174 (patch)
treee56ac235cd8752834f50457828bd235f2ddd4820
parent88712fec27d28655a6a4319eda14daff7e21457e (diff)
parent356aa9b7352e4e0d1e4376e53a4999aefeb9ec63 (diff)
downloadmullvadvpn-d60ccf829a9d2c5d8ddf7e549e72c8d31a090174.tar.xz
mullvadvpn-d60ccf829a9d2c5d8ddf7e549e72c8d31a090174.zip
Merge branch 'fix-windows-frontend-ci'
-rw-r--r--.github/workflows/frontend.yml5
-rw-r--r--.travis.yml15
-rw-r--r--gui/package-lock.json17
-rw-r--r--gui/package.json2
-rw-r--r--gui/test/logging.spec.ts30
5 files changed, 33 insertions, 36 deletions
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index ddb6196bdf..6862e2922c 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -12,10 +12,13 @@ jobs:
check-frontend:
strategy:
matrix:
- os: [ubuntu-latest]
+ os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
+ # Prevent conversion of line-breaks on Windows
+ - run: git config --global core.autocrlf input
+
- name: Checkout repository
uses: actions/checkout@v2
diff --git a/.travis.yml b/.travis.yml
index 9832cc032d..01cee829fb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,18 +25,6 @@ matrix:
- npm run build
- npm test
- - os: windows
- language: node_js
- node_js: '12'
- name: Desktop Frontend, Windows
- cache: npm
- before_install:
- # npm fails to upgrade itself if just doing `npm install -g npm`. See this issue:
- # https://travis-ci.community/t/command-npm-i-g-npm-latest-fails/431/5
- - node `npm prefix -g`/node_modules/npm/bin/npm-cli.js i -g npm@latest
- install: *node_install
- script: *node_script
-
# iOS
- language: swift
osx_image: xcode12.2
@@ -118,9 +106,6 @@ matrix:
before_install: *rust_windows_before_install
script: *rust_windows_script
- allow_failures:
- - name: Desktop Frontend, Windows
-
notifications:
email:
on_success: never
diff --git a/gui/package-lock.json b/gui/package-lock.json
index 6fea0ef7b2..c66e9794ac 100644
--- a/gui/package-lock.json
+++ b/gui/package-lock.json
@@ -78,7 +78,7 @@
"semver": "^7.3.2",
"sinon": "^7.1.1",
"spa-server": "^1.0.0",
- "ts-node": "^9.1.0",
+ "ts-node": "^9.1.1",
"tsc-watch": "^4.2.9",
"typescript": "^4.1.5",
"vinyl-buffer": "^1.0.1",
@@ -16250,9 +16250,9 @@
}
},
"node_modules/ts-node": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.0.tgz",
- "integrity": "sha512-0yqcL4sgruCvM+w64LiAfNJo6+lHfCYc5Ajj4yiLNkJ9oZ2HWaa+Kso7htYOOxVQ7+csAjdUjffOe9PIqC4pMg==",
+ "version": "9.1.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz",
+ "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==",
"dev": true,
"dependencies": {
"arg": "^4.1.0",
@@ -16270,6 +16270,9 @@
},
"engines": {
"node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=2.7"
}
},
"node_modules/ts-node/node_modules/diff": {
@@ -31183,9 +31186,9 @@
}
},
"ts-node": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.0.tgz",
- "integrity": "sha512-0yqcL4sgruCvM+w64LiAfNJo6+lHfCYc5Ajj4yiLNkJ9oZ2HWaa+Kso7htYOOxVQ7+csAjdUjffOe9PIqC4pMg==",
+ "version": "9.1.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz",
+ "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==",
"dev": true,
"requires": {
"arg": "^4.1.0",
diff --git a/gui/package.json b/gui/package.json
index 943fe28226..12c411e90f 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -84,7 +84,7 @@
"semver": "^7.3.2",
"sinon": "^7.1.1",
"spa-server": "^1.0.0",
- "ts-node": "^9.1.0",
+ "ts-node": "^9.1.1",
"tsc-watch": "^4.2.9",
"typescript": "^4.1.5",
"vinyl-buffer": "^1.0.1",
diff --git a/gui/test/logging.spec.ts b/gui/test/logging.spec.ts
index 7d4edf386f..92f1a92e1f 100644
--- a/gui/test/logging.spec.ts
+++ b/gui/test/logging.spec.ts
@@ -2,14 +2,15 @@ import { expect, spy } from 'chai';
import fs from 'fs';
import sinon from 'sinon';
import { it, describe, before, beforeEach, after } from 'mocha';
+import path from 'path';
import { Logger } from '../src/shared/logging';
import { backupLogFile, rotateOrDeleteFile } from '../src/main/logging';
import { LogLevel } from '../src/shared/logging-types';
-const aPath = 'log-directory/a.log';
-const oldAPath = 'log-directory/a.old.log';
-const bPath = 'log-directory/b.log';
-const oldBPath = 'log-directory/b.old.log';
+const aPath = path.normalize('log-directory/a.log');
+const oldAPath = path.normalize('log-directory/a.old.log');
+const bPath = path.normalize('log-directory/b.log');
+const oldBPath = path.normalize('log-directory/b.old.log');
const initialFileState = {
[aPath]: 'a',
@@ -24,23 +25,28 @@ describe('Logging', () => {
before(() => {
sandbox = sinon.createSandbox();
- sandbox.stub(fs, 'accessSync').callsFake((path) => {
- if (files[path as string] === undefined) {
+ sandbox.stub(fs, 'accessSync').callsFake((filePath) => {
+ const normalizedPath = path.normalize(filePath as string);
+ if (files[normalizedPath] === undefined) {
throw Error('File not found');
}
});
sandbox.stub(fs, 'renameSync').callsFake((oldPath, newPath) => {
- files[newPath as string] = files[oldPath as string];
- fs.unlinkSync(oldPath);
+ const normalizedOldPath = path.normalize(oldPath as string);
+ const normalizedNewPath = path.normalize(newPath as string);
+ files[normalizedNewPath] = files[normalizedOldPath];
+ fs.unlinkSync(normalizedOldPath);
});
- sandbox.stub(fs, 'unlinkSync').callsFake((path) => {
- delete files[path as string];
+ sandbox.stub(fs, 'unlinkSync').callsFake((filePath) => {
+ const normalizedPath = path.normalize(filePath as string);
+ delete files[normalizedPath];
});
- sandbox.stub(fs, 'readFileSync').callsFake((path) => {
- return files[path as string] ?? '';
+ sandbox.stub(fs, 'readFileSync').callsFake((filePath) => {
+ const normalizedPath = path.normalize(filePath as string);
+ return files[normalizedPath] ?? '';
});
});