From 1ca82d1c00188b6a58379c730c062e15d86050e3 Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Mon, 9 Dec 2019 21:03:33 +0000 Subject: [PATCH] Fix remaining eval warning in release extension, lint on CI --- .circleci/config.yml | 6 +++--- README.md | 1 - build | 2 ++ server/test_grasp.py | 2 +- server/test_with_browser.py | 4 ++-- src/manifest.json | 3 +-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 276d904..a6e45d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: - image: circleci/node:latest steps: - checkout - - run: sudo npm install -g npm + - run: sudo npm install -g npm web-ext - restore_cache: keys: @@ -20,7 +20,7 @@ jobs: paths: - ./node_modules - - run: npm run build + - run: ./build --chrome --lint # TODO ugh. is there a way for a job to inherit a cloned repo after npm run build has ran?? I'd like to separate build and check steps # TODO ok, apparently it's a custom executor? https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs @@ -40,7 +40,7 @@ jobs: command: | for browser in 'chrome'; do - zip -r -j "/tmp/grasp.zip" build/* + zip -r -j "/tmp/grasp.zip" dist/* done # TODO ugh, also can't use env variables in artifacts... diff --git a/README.md b/README.md index f7d62f5..1e21054 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ The only test(s) that don't run on CI at the moment (e.g. due to lack of X serve Extra tests (not integrated in CI yet): -- `./build --lint` - `scripts/test_with_browser.py` diff --git a/build b/build index 88b10ca..c00a7f4 100755 --- a/build +++ b/build @@ -33,6 +33,8 @@ def main(): *args, ], **kwargs) + # TODO do I need that back for dev manifest?? + # "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'" maybe_release = {'NODE_ENV': 'production'} if args.release else {} env = { 'TARGET': target, diff --git a/server/test_grasp.py b/server/test_grasp.py index 72a0756..c730e3f 100644 --- a/server/test_grasp.py +++ b/server/test_grasp.py @@ -26,7 +26,7 @@ def grasp_test_server(capture_file: Path, port: str, template=None): def test_server(tmp_path: Path): cfile = tmp_path / 'test-capture.org' - PORT = '17777' + PORT = '17890' def send(url: str, title: str): # TODO eh, not sure if there is anything easier than httpie diff --git a/server/test_with_browser.py b/server/test_with_browser.py index 0383191..1f95848 100755 --- a/server/test_with_browser.py +++ b/server/test_with_browser.py @@ -14,7 +14,7 @@ from selenium import webdriver # type: ignore from test_grasp import grasp_test_server -addon_path = (Path(__file__).parent.parent / 'build').absolute() +addon_path = (Path(__file__).parent.parent / 'dist').absolute() def skip_if_ci(reason): @@ -91,7 +91,7 @@ def trigger_grasp(): @skip_if_ci('no GUI to run the browser..') def test(tmp_path: Path): capture_file = tmp_path / 'output.org' - port = '17777' + port = '17890' template = '* [[%:link][%:description]]' with grasp_test_server(capture_file=capture_file, template=template, port=port), get_webdriver() as driver: diff --git a/src/manifest.json b/src/manifest.json index 9c8a049..f3e20d6 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -23,6 +23,5 @@ "description": "Capture page, with extra information" } }, - "manifest_version": 2, - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'" + "manifest_version": 2 }