#!/bin/bash -xe echo "starting sanity test..." export SEALIOUS_PORT=$PORT SEALIOUS_BASE_URL=$(cat .base_url) export SEALIOUS_BASE_URL ./npm.sh ci --no-progress --no-color ./npm.sh run build --no-progress --no-color --ignore-scripts ./npm.sh run typecheck --no-progress --no-color --ignore-scripts # no need to run build, it's automatically ran after ci #./npm.sh --no-TTY --user="$UID" run build ./npm.sh run lint-report parse_command=$(cat << EOM console.log( JSON.stringify([ ...JSON.parse(fs.readFileSync("./.eslint-result.json", "utf-8")) .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, })), ...JSON.parse(fs.readFileSync("./.stylelint-result.json", "utf-8")) .map((fileResult) => fileResult.warnings.map((message) => ({ ...message, path: fileResult.source.replace("/opt/sealious-app/", ""), })), ) .flat() .map((message) => ({ name: message.rule, code: message.rule, severity: message.severity, path: message.path, line: message.line, char: message.column, description: message.text, })), ]), ); EOM ) node -e "$parse_command" > lint-report.json docker-compose up -d meilisearch mailcatcher playwright docker compose run --user="$UID" \ -e "FORCE_COLOR=0" \ test npx playwright install firefox docker compose up -d test docker compose exec -T --user="$UID" \ -e "SEALIOUS_MONGO_PORT=27017" \ -e "SEALIOUS_MONGO_HOST=db" \ -e "SEALIOUS_PORT=8080" \ -e "SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL" \ -e "MEILISEARCH_HOST=http://meilisearch:7700" \ -e "SEALIOUS_MAILCATCHER_HOST=mailcatcher" \ -e "SEALIOUS_MAILCATCHER_API_PORT=1080" \ -e "SEALIOUS_MAILCATCHER_SMTP_PORT=1025" \ -e "FORCE_COLOR=0" \ test \ npm run --ignore-scripts test-ci ./npm.sh run --silent cover-arcanist > coverage.json