Skip to content

test: begin unit testing on windows #1106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ on:
branches: [master]

jobs:
unit-tests-windows:
runs-on: windows-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn -s build
- run: yarn -s test runtime/app runtime/schema/settings lib/layout lib/build lib/graphql-client
# todo all
# - run: yarn -s test runtime/app runtime/schema/settings lib/layout lib/build lib/add-to-context-extractor runtime/schema/index lib/nexus-schema-backing-types lib/graphql-client runtime/server lib/plugin lib/glocal runtime/schema/settings-mapper lib/watcher

unit-tests:
runs-on: ubuntu-latest
strategy:
Expand All @@ -17,7 +34,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn -s build
- run: yarn -s test:unit

system-tests:
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ on:
branches: [master]

jobs:
unit-tests-windows:
runs-on: windows-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn -s build
- run: yarn -s test runtime/app runtime/schema/settings lib/layout lib/build lib/graphql-client
# todo all
# - run: yarn -s test runtime/app runtime/schema/settings lib/layout lib/build lib/add-to-context-extractor runtime/schema/index lib/nexus-schema-backing-types lib/graphql-client runtime/server lib/plugin lib/glocal runtime/schema/settings-mapper lib/watcher

unit-tests:
runs-on: ubuntu-latest
strategy:
Expand All @@ -17,7 +34,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn -s build
- run: yarn -s test:unit

system-tests:
Expand All @@ -42,7 +59,7 @@ jobs:
git config --global user.email [email protected]
- run: yarn -s test system/${{matrix.test-case}}
publish:
needs: [unit-tests, system-tests]
needs: [unit-tests, unit-tests-windows, system-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@types/lodash": "4.14.152",
"@types/node": "13.13.9",
"@types/parse-json": "^4.0.0",
"cross-env": "^7.0.2",
"docsify": "4.11.3",
"docsify-cli": "4.4.0",
"doctoc": "1.4.0",
Expand Down Expand Up @@ -107,7 +108,7 @@
"postpublish": "yarn clean",
"postinstall": "node scripts/postinstall",
"prepublishOnly": "yarn build",
"test": "FORCE_COLOR=3 LOG_PRETTY=true DEBUG=true jest --verbose --testTimeout 360000 --forceExit",
"test": "cross-env FORCE_COLOR=3 LOG_PRETTY=true DEBUG=true jest --verbose --testTimeout 360000 --forceExit",
"test:unit": "yarn test src",
"dev:test": "yarn test --watch src",
"dev": "yarn clean && node scripts/build-module-facades && tsc -b tsconfig.cjs.json -w"
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1887,6 +1887,13 @@ crc-32@^1.2.0:
exit-on-epipe "~1.0.1"
printj "~1.1.0"

cross-env@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.2.tgz#bd5ed31339a93a3418ac4f3ca9ca3403082ae5f9"
integrity sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==
dependencies:
cross-spawn "^7.0.1"

cross-fetch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.4.tgz#7bef7020207e684a7638ef5f2f698e24d9eb283c"
Expand Down Expand Up @@ -1924,6 +1931,15 @@ cross-spawn@^7.0.0:
shebang-command "^2.0.0"
which "^2.0.1"

cross-spawn@^7.0.1:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
which "^2.0.1"

crypto-random-string@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e"
Expand Down