Test in jenkins - attempt #1
Reviewers: #reviewers Subscribers: jenkins-user Differential Revision: https://hub.sealcode.org/D1522
This commit is contained in:
parent
ea65ae01a9
commit
b46ba714c3
@ -1,8 +1,5 @@
|
||||
{
|
||||
"phabricator.uri": "https://hub.sealcode.org/",
|
||||
"arc.land.onto.default": "master",
|
||||
"load": ["arcanist-linters", "arc-unit-mocha/src"],
|
||||
"unit.engine": "MochaEngine",
|
||||
"unit.mocha.include": ["./lib/**/*.test.js"],
|
||||
"unit.mocha.dockerRoot": "/opt/sealious-app"
|
||||
"load": []
|
||||
}
|
||||
|
12
.arclint
12
.arclint
@ -1,13 +1,3 @@
|
||||
{
|
||||
"linters": {
|
||||
"prettier": {
|
||||
"type": "prettier",
|
||||
"bin": "./node_modules/.bin/prettier",
|
||||
"include": ["(\\.[tj]sx?$)", "(\\.s?css$)"]
|
||||
},
|
||||
"eslint": {
|
||||
"type": "eslint",
|
||||
"include": ["(src/.*\\.tsx?$)", "(src/.*\\.js$)"]
|
||||
}
|
||||
}
|
||||
"linters": {}
|
||||
}
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -43,3 +43,5 @@ src/back/jdd-components/components.ts
|
||||
src/back/routes/routes.ts
|
||||
src/back/routes/urls.ts
|
||||
src/includes.css
|
||||
.eslint-result.json
|
||||
lint-report.json
|
@ -1,2 +1,2 @@
|
||||
mkdir -p docker_node_modules
|
||||
docker-compose up -d
|
||||
docker compose up -d
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash -xe
|
||||
set -e
|
||||
|
||||
docker-compose down
|
||||
docker compose down
|
||||
|
||||
npm install @sealcode/sealgen
|
||||
npx sealgen make-env
|
||||
@ -10,15 +10,15 @@ cp secrets.example.json secrets.json
|
||||
export SEALIOUS_PORT="${PORT}0"
|
||||
SEALIOUS_BASE_URL=$(cat .base_url)
|
||||
export SEALIOUS_BASE_URL
|
||||
echo "PORT=$PORT" >> .env
|
||||
echo "PORT=$PORT" >>.env
|
||||
|
||||
mkdir -p node_modules
|
||||
mkdir -p docker_node_modules
|
||||
|
||||
# https://github.com/docker/compose/issues/4725
|
||||
docker-compose build
|
||||
docker compose build
|
||||
|
||||
docker-compose up -d db
|
||||
./npm.sh --no-TTY ci && ./npm.sh --no-TTY run build
|
||||
docker compose up -d db
|
||||
./npm.sh --no-TTY ci && ./npm.sh --no-TTY run build
|
||||
|
||||
rm -f log.html
|
||||
|
@ -4,13 +4,31 @@ export SEALIOUS_PORT=$PORT
|
||||
SEALIOUS_BASE_URL=$(cat .base_url)
|
||||
export SEALIOUS_BASE_URL
|
||||
|
||||
./npm.sh --no-TTY --user="$UID" run typecheck:front
|
||||
./npm.sh --no-TTY --user="$UID" run typecheck:back
|
||||
./npm.sh ci --no-progress --no-color
|
||||
./npm.sh run install-test-deps --no-progress --no-color
|
||||
./npm.sh run build --no-progress --no-color --ignore-scripts
|
||||
./npm.sh run typecheck --no-progress --no-color --ignore-scripts
|
||||
|
||||
docker-compose run --user="$UID" \
|
||||
# no need to run build, it's automatically ran after ci
|
||||
#./npm.sh --no-TTY --user="$UID" run build
|
||||
|
||||
./npm.sh run lint-report
|
||||
|
||||
node -e 'console.log(JSON.stringify(JSON.parse(fs.readFileSync("./.eslint-result.json")).map(fileResult => fileResult.messages.map(message=>({...message, path: fileResult.filePath.replace("/opt/sealious-app/", "")}))).flat().map(message=>({name: message.ruleId, code: message.ruleId, severity: message.severity==1 ? "warning" : "error", path: message.path, line: message.line, char: message.column, description: message.message}))))' \
|
||||
>lint-report.json
|
||||
|
||||
CONTAINER_ID=$(docker compose run -d --user="$UID" \
|
||||
-e "SEALIOUS_MONGO_PORT=27017" \
|
||||
-e "SEALIOUS_MONGO_HOST=db" \
|
||||
-e "SEALIOUS_PORT=$SEALIOUS_PORT" \
|
||||
-e "SEALIOUS_PORT=8080" \
|
||||
-e "SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL" \
|
||||
-e "SEALIOUS_SANITY=true" \
|
||||
test
|
||||
-e "SEALIOUS_MAILCATCHER_HOST=mailcatcher" \
|
||||
-e "SEALIOUS_MAILCATCHER_API_PORT=1080" \
|
||||
-e "SEALIOUS_MAILCATCHER_SMTP_PORT=1025" \
|
||||
-e "WITH_WEBHINT=TRUE" \
|
||||
-e "FORCE_COLOR=0" \
|
||||
test npm run test-reports)
|
||||
|
||||
docker logs -f $CONTAINER_ID
|
||||
|
||||
exit $(docker inspect $CONTAINER_ID --format='{{.State.ExitCode}}')
|
||||
|
@ -6,9 +6,9 @@ export SEALIOUS_BASE_URL
|
||||
|
||||
./npm.sh --no-TTY --user="$UID" run build:front
|
||||
|
||||
docker-compose up -d mailcatcher
|
||||
docker compose up -d mailcatcher
|
||||
|
||||
docker-compose run --user="$UID" \
|
||||
docker compose run --user="$UID" \
|
||||
-e "SEALIOUS_MONGO_PORT=27017" \
|
||||
-e "SEALIOUS_MONGO_HOST=db" \
|
||||
-e "SEALIOUS_PORT=$SEALIOUS_PORT" \
|
||||
|
@ -4,6 +4,5 @@ export SEALIOUS_PORT="${PORT}0"
|
||||
SEALIOUS_BASE_URL=$(cat .base_url)
|
||||
export SEALIOUS_BASE_URL
|
||||
|
||||
docker-compose down --volumes
|
||||
docker compose down --volumes
|
||||
rm -rf node_modules
|
||||
|
||||
|
19
package-lock.json
generated
19
package-lock.json
generated
@ -14,7 +14,7 @@
|
||||
"@koa/router": "^12.0.1",
|
||||
"@sealcode/file-manager": "^1.0.2",
|
||||
"@sealcode/jdd": "^0.4.10",
|
||||
"@sealcode/sealgen": "^0.15.30",
|
||||
"@sealcode/sealgen": "^0.15.45",
|
||||
"@sealcode/ts-predicates": "^0.6.2",
|
||||
"@types/kill-port": "^2.0.0",
|
||||
"@types/leaflet": "^1.9.8",
|
||||
@ -844,13 +844,14 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@sealcode/sealgen": {
|
||||
"version": "0.15.30",
|
||||
"resolved": "https://registry.npmjs.org/@sealcode/sealgen/-/sealgen-0.15.30.tgz",
|
||||
"integrity": "sha512-Smj73M9pNhfTgSjP4bwHokU1HTHMdcixgy2fGEO9bDKH/2e19XVGcCUBYHBiFB/i8OBuwJYBcDfH4wt2U/TEUA==",
|
||||
"version": "0.15.45",
|
||||
"resolved": "https://registry.npmjs.org/@sealcode/sealgen/-/sealgen-0.15.45.tgz",
|
||||
"integrity": "sha512-E4jeaeNaMQvhD8AUc/BzXDr85l6MaON7gHuZxUtEnJ7z0Qogf0UBmMd0HECoUAOPeiGbcTM8aKB0cZ1oJrCpdw==",
|
||||
"dependencies": {
|
||||
"@koa/router": "^12.0.1",
|
||||
"@sealcode/file-manager": "^1.0.2",
|
||||
"@sealcode/ts-predicates": "^0.4.3",
|
||||
"chokidar": "^3.6.0",
|
||||
"deepmerge": "^4.3.1",
|
||||
"esbuild": "^0.20.0",
|
||||
"escape-goat": "^4.0.0",
|
||||
@ -863,7 +864,7 @@
|
||||
"prettier": "^2.7.1",
|
||||
"prompts": "^2.4.2",
|
||||
"recursive-readdir": "^2.2.3",
|
||||
"tempstream": "^0.3.4",
|
||||
"tempstream": "^0.4.0",
|
||||
"tiny-glob": "^0.2.9",
|
||||
"ws": "^8.16.0",
|
||||
"yargs": "^17.6.2"
|
||||
@ -882,6 +883,14 @@
|
||||
"resolved": "https://registry.npmjs.org/@sealcode/ts-predicates/-/ts-predicates-0.4.3.tgz",
|
||||
"integrity": "sha512-UNSEacu7Ye8q0N8AJCJy37oJvv3w2OXKGkUnP7xO5lOY9DQviDPRDQhVaZdJ3/xMzXLm4UE3389ihctrPaov/A=="
|
||||
},
|
||||
"node_modules/@sealcode/sealgen/node_modules/tempstream": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.4.0.tgz",
|
||||
"integrity": "sha512-NkO6l6LUvZEnxTicz143PbHHHLLJvp8yQy1UgIkNU5S0eGxyf0eKv2C81rAnyrff1Ehk8KzqDOhjaMTa6U0N4w==",
|
||||
"dependencies": {
|
||||
"classnames": "^2.5.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@sealcode/ts-predicates": {
|
||||
"version": "0.6.2",
|
||||
"license": "ISC",
|
||||
|
20
package.json
20
package.json
@ -5,25 +5,27 @@
|
||||
"main": "./dist/back/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "docker-compose up -d db && node .",
|
||||
"start-watch": "SEALIOUS_PORT=$SEALIOUS_PORT SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL nodemon --enable-source-maps --ignore ./uploaded_files . --ignore ./cache",
|
||||
"start": "docker compose up -d db && node .",
|
||||
"start-watch": "SEALIOUS_PORT=$SEALIOUS_PORT SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL nodemon --enable-source-maps --ignore ./uploaded_files --ignore ./cache .",
|
||||
"typecheck:back": "tsc --noEmit --target es6 --lib es2021,dom -p tsconfig-back.json",
|
||||
"typecheck:front": "tsc --noEmit --target es6 --lib es2015,dom -p tsconfig-front.json",
|
||||
"typecheck:front": "tsc --noEmit --target es6 --lib es2021,dom -p tsconfig-front.json",
|
||||
"typecheck": "npm run typecheck:back && npm run typecheck:front",
|
||||
"prewatch": "rm -rf dist/* && npm run build --ignore-scripts",
|
||||
"build": "rm -rf dist && sealgen build ",
|
||||
"postbuild": "npm run typecheck && npm run lint",
|
||||
"watch": "multiple-scripts-tmux -p watch",
|
||||
"reset-db": "docker-compose down && docker-compose up -d",
|
||||
"reset-db": "docker compose down -v && docker compose up -d",
|
||||
"install-test-deps": "npx playwright install firefox && cd webhint && npm install && ./use-fork.sh",
|
||||
"pretest": "npm run build && docker-compose up -d",
|
||||
"pretest": "npm run build && docker compose up -d",
|
||||
"test": "node test.cjs",
|
||||
"full-test": "WITH_WEBHINT=TRUE npm run test",
|
||||
"prepare": "npm run build && npm run install-test-deps",
|
||||
"lint": "eslint src",
|
||||
"preinstrument": "npm run build && rm -fr .xunit coverage dist-instrumented",
|
||||
"lint-report": "npm run --silent lint -- --format json > .eslint-result.json",
|
||||
"preinstrument": "npm run build --ignore-scripts && rm -fr .xunit coverage dist-instrumented",
|
||||
"instrument": "npx nyc instrument --exclude \"\" dist dist-instrumented",
|
||||
"pretest-reports": "npm run instrument && docker-compose up -d",
|
||||
"test-reports": "npx nyc --exclude \"\" ./node_modules/.bin/mocha --recursive --timeout=10000 --require source-map-support/register --reporter xunit --reporter-option output=.xunit 'dist-instrumented/**/*.test.js' --exit && nyc report --reporter clover --exclude \"\"",
|
||||
"pretest-reports": "npm run instrument",
|
||||
"test-reports": "npx nyc --exclude \"\" ./node_modules/.bin/mocha --recursive --timeout=10000 --require source-map-support/register 'dist-instrumented/**/*.test.js' --exit && nyc report --reporter cobertura --exclude \"\"",
|
||||
"precover-html": "rm -rf coverate/lcov-report",
|
||||
"cover-html": "npm run test-reports && nyc report --reporter lcov --exclude \"\" && xdg-open coverage/lcov-report/index.html"
|
||||
},
|
||||
@ -43,7 +45,7 @@
|
||||
"@koa/router": "^12.0.1",
|
||||
"@sealcode/file-manager": "^1.0.2",
|
||||
"@sealcode/jdd": "^0.4.10",
|
||||
"@sealcode/sealgen": "^0.15.30",
|
||||
"@sealcode/sealgen": "^0.15.45",
|
||||
"@sealcode/ts-predicates": "^0.6.2",
|
||||
"@types/kill-port": "^2.0.0",
|
||||
"@types/leaflet": "^1.9.8",
|
||||
|
@ -26,6 +26,7 @@ export default new (class HorizontalScrollerDemoPage extends Page {
|
||||
<div>
|
||||
<button
|
||||
class="prev-button"
|
||||
type="button"
|
||||
data-action="horizontal-scroller#scrollLeft"
|
||||
>
|
||||
{" "}
|
||||
@ -33,6 +34,7 @@ export default new (class HorizontalScrollerDemoPage extends Page {
|
||||
</button>
|
||||
<button
|
||||
class="next-button"
|
||||
type="button"
|
||||
data-action="horizontal-scroller#scrollRight"
|
||||
>
|
||||
{" "}
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { withProdApp } from "../test_utils/with-prod-app.js";
|
||||
import { VERY_LONG_TEST_TIMEOUT, webhintURL } from "../test_utils/webhint.js";
|
||||
import { HorizontalScrollerDemoURL } from "./urls.js";
|
||||
import { getBrowser } from "../test_utils/browser-creator.js";
|
||||
import type { Browser, BrowserContext, Page } from "@playwright/test";
|
||||
|
||||
describe("HorizontalScrollerDemo webhint", () => {
|
||||
it("doesn't crash", async function () {
|
||||
@ -16,25 +14,3 @@ describe("HorizontalScrollerDemo webhint", () => {
|
||||
});
|
||||
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||
});
|
||||
|
||||
describe("HorizontalScrollerDemo", () => {
|
||||
let page: Page;
|
||||
let browser: Browser;
|
||||
let context: BrowserContext;
|
||||
|
||||
beforeEach(async () => {
|
||||
browser = await getBrowser();
|
||||
context = await browser.newContext();
|
||||
page = await context.newPage();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await context.close();
|
||||
});
|
||||
|
||||
it("works as expected", async function () {
|
||||
return withProdApp(async ({ base_url }) => {
|
||||
await page.goto(base_url + HorizontalScrollerDemoURL);
|
||||
});
|
||||
}).timeout(VERY_LONG_TEST_TIMEOUT);
|
||||
});
|
||||
|
4692
webhint/package-lock.json
generated
4692
webhint/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user