-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR cleans up and standardizes utility and npm scripts across the repo. - remove the `data-pipeline` directory in server - remove the data-pipeline rollup config - generalize the bin rollup config so it builds any ts script - add runtime reading of ts script names so the bin script can build all of them if individual ones aren't specified - standardize names of npm scripts. all scripts like `test` run all the tests, and if needed follow the pattern `test:unit` (for example) if there are more targeted tests to run (also applies to builds, etc) - add server e2e to travis - spend 5 gd hours troubleshooting why the server was failing in travis - simplify lint scripts (prettier step was removed since eslint/eslint prettier plugins should serve the same purpose) - this apparently exposed some type problems; fix those
- Loading branch information
1 parent
55257d2
commit dbc2091
Showing
32 changed files
with
1,594 additions
and
1,617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
language: node_js | ||
node_js: | ||
- "12" | ||
# if using Ubuntu 16 need this library for cypress | ||
# https://github.com/cypress-io/cypress-documentation/pull/1647 | ||
addons: | ||
apt: | ||
packages: | ||
- libgconf-2-4 | ||
before_install: | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.1 | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.4 | ||
- export PATH="$HOME/.yarn/bin:$PATH" | ||
cache: | ||
yarn: true | ||
node_js: | ||
- "12" | ||
directories: | ||
# we also need to cache folder with Cypress binary | ||
- ~/.cache | ||
script: | ||
- yarn install | ||
- mv packages/upswyng-native/config.example.ts packages/upswyng-native/config.ts | ||
- yarn run build-local-packages | ||
- yarn run ci-lint | ||
- yarn run test | ||
- yarn workspace @upswyng/upswyng-server server-build | ||
- yarn workspace @upswyng/upswyng-server worker-build | ||
- yarn workspace @upswyng/upswyng-server rollup --config data-pipeline.rollup.config.js | ||
- yarn build-local-packages | ||
- yarn workspace @upswyng/upswyng-server build:bin | ||
- yarn run lint:ci | ||
- yarn test:ci | ||
- yarn workspace @upswyng/upswyng-server build:server | ||
- yarn workspace @upswyng/upswyng-server build:worker | ||
- CI=false yarn workspace @upswyng/upswyng-web build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# https://github.com/heroku/heroku-buildpack-multi-procfile | ||
web: yarn workspace @upswyng/upswyng-server run server-start | ||
worker: yarn workspace @upswyng/upswyng-server run worker-start | ||
web: yarn workspace @upswyng/upswyng-server run start:server | ||
worker: yarn workspace @upswyng/upswyng-server run start:worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* Sets up a redis instance for testing | ||
* | ||
* Writes two files to its directory: | ||
* .redispid contains the PID of the child process which should be killed once the test is complete. | ||
* .redisuri contains the connection string/uri of the instance | ||
*/ | ||
|
||
/* eslint-disable */ | ||
const fs = require("fs"); | ||
const { spawn } = require("child_process"); | ||
const child = spawn("node", [`${__dirname}/start_memory_redis_impl.js`], { | ||
detached: true, // don't SIGHUP when the parent proc exits | ||
stdio: ["ignore", "pipe", "pipe"], | ||
}); | ||
|
||
child.stderr.pipe(process.stderr); | ||
child.stdout.on("data", chunk => { | ||
const pid = String(child.pid).trim(); | ||
const uri = String(chunk).trim(); | ||
const match = uri.match( | ||
/^CONNECTION_STRING=(?<connectionString>redis:\/\/.+:[0-9]{4,})$/ | ||
); | ||
if (!match) { | ||
console.error(`Invalid connection string: ${uri}`); | ||
process.exit(1); | ||
} | ||
const { connectionString } = match.groups; | ||
fs.writeFileSync(`${__dirname}/.redisuri`, connectionString); | ||
fs.writeFileSync(`${__dirname}/.redispid`, pid); | ||
|
||
console.info(`🎉 Started in-memory redis`); | ||
console.info(`PID:\t\t${pid}`); | ||
console.info(`Connection URI:\t${connectionString}`); | ||
|
||
// got data, maybe look at it to verify that it started up ok | ||
child.unref(); // let the process close normally | ||
process.exit(0); | ||
}); |
17 changes: 17 additions & 0 deletions
17
packages/upswyng-server/cypress/start_memory_redis_impl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* Starts an in-memory redis instance. | ||
* Logs CONNECTION_STRING=<connection string> once started | ||
*/ | ||
|
||
/* eslint-disable */ | ||
const tmpRedis = require("tmp-redis"); | ||
const getPort = require("get-port"); | ||
|
||
getPort({ port: 6379 }).then(p => { | ||
tmpRedis(p, (e, _shutdown) =>{ | ||
if (e) throw e; | ||
console.info(`CONNECTION_STRING=redis://localhost:${p}`); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.