Skip to content

Commit

Permalink
chore: add missing packages to consumer test (#3737)
Browse files Browse the repository at this point in the history
* feat: depcheck

* feat: separate workflows instead of conditional exec

* Revert "bump: runtypes (#3648)"

This reverts commit c7a22fb.

* Downgrade other runtypes references

* chore: add missing packages to consumer test

Fixes #3736

* fix: downlevel runtime integrations

* fix: better consumer test errors

* feat: zod replaces runtypes for tsc compat

* fix: runtime error devexp, luis tests

* clean botframework-schema references in tests

Co-authored-by: stevengum <14935595+stevengum@users.noreply.github.com>
  • Loading branch information
Josh Gummersall and stevengum authored Jun 22, 2021
1 parent fec4bfe commit 542641d
Show file tree
Hide file tree
Showing 69 changed files with 1,101 additions and 293 deletions.
2 changes: 2 additions & 0 deletions .depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignores: ["mocha", "rimraf", "sinon"]
ignorePatterns: [".eslintrc.json", "lib"]
42 changes: 42 additions & 0 deletions .github/workflows/depcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: depcheck.yml

on:
workflow_dispatch:
push:
branches:
- main
- '4.12'
- '4.13'
pull_request:
branches:
- main
- '4.12'
- '4.13'

jobs:
ci:
name: depcheck
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: use node 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x

- name: yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node14.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: yarn depcheck
run: yarn depcheck
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: lint.yml

on:
workflow_dispatch:
push:
branches:
- main
- '4.12'
- '4.13'
pull_request:
branches:
- main
- '4.12'
- '4.13'

jobs:
ci:
name: lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: use node 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x

- name: yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node14.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: yarn lint
run: yarn lint
45 changes: 45 additions & 0 deletions .github/workflows/test-compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: test-compat.yml

on:
workflow_dispatch:
push:
branches:
- main
- '4.12'
- '4.13'
pull_request:
branches:
- main
- '4.12'
- '4.13'

jobs:
ci:
name: test:compat
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: use node 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x

- name: yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node14.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: yarn build
run: yarn build

- name: yarn test:compat
run: yarn test:compat
45 changes: 45 additions & 0 deletions .github/workflows/test-consumer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: test-consumer.yml

on:
workflow_dispatch:
push:
branches:
- main
- '4.12'
- '4.13'
pull_request:
branches:
- main
- '4.12'
- '4.13'

jobs:
ci:
name: test:consumer
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: use node 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x

- name: yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node14.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: yarn build
run: yarn build

- name: yarn test:consumer
run: yarn test:consumer
42 changes: 42 additions & 0 deletions .github/workflows/test-repoutils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: test-repoutils.yml

on:
workflow_dispatch:
push:
branches:
- main
- '4.12'
- '4.13'
pull_request:
branches:
- main
- '4.12'
- '4.13'

jobs:
ci:
name: test:repoutils
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: use node 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x

- name: yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node14.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: yarn test:repoutils
run: yarn test:repoutils
45 changes: 45 additions & 0 deletions .github/workflows/test-schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: test-schemas.yml

on:
workflow_dispatch:
push:
branches:
- main
- '4.12'
- '4.13'
pull_request:
branches:
- main
- '4.12'
- '4.13'

jobs:
ci:
name: test:schemas
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: use node 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x

- name: yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node14.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: yarn build
run: yarn build

- name: yarn test:schemas
run: yarn test:schemas
22 changes: 1 addition & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,15 @@ jobs:
- name: yarn
run: yarn --frozen-lockfile

- name: yarn test:repoutils
if: matrix.node-version == '14.x'
run: yarn test:repoutils

- name: yarn lint
if: matrix.node-version == '12.x'
run: yarn lint

- name: yarn build
run: yarn build

- name: yarn test:github
run: yarn test:github

- name: coveralls
if: matrix.node-version == '12.x'
if: matrix.node-version == '14.x'
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: .lcov.info

- name: yarn test:consumer
if: matrix.node-version == '14.x'
run: yarn test:consumer

- name: yarn test:schemas
if: matrix.node-version == '12.x'
run: yarn test:schemas

- name: yarn test:compat
if: matrix.node-version == '14.x'
run: yarn test:compat
1 change: 1 addition & 0 deletions libraries/adaptive-expressions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"browserify": "browserify lib/browser.js -s AEL --debug -p [ tinyify --no-flat ] | exorcist lib/browser.js.map | sponge lib/browser.js",
"postbuild": "rimraf lib/browser.* && shx cp lib/index.js lib/browser.js && yarn browserify",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"build-docs": "typedoc --theme markdown --entryPoint adaptive-expressions --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\adaptive-expressions .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - Expression\" --readme none",
"test": "yarn build && mocha tests --timeout 60000",
"test:compat": "api-extractor run --verbose",
Expand Down
1 change: 1 addition & 0 deletions libraries/botbuilder-ai-luis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"scripts": {
"build": "tsc -b",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint . --ext .js,.ts",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum"
},
Expand Down
3 changes: 2 additions & 1 deletion libraries/botbuilder-ai-orchestrator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"botbuilder-core": "4.1.6",
"botbuilder-dialogs": "4.1.6",
"botbuilder-dialogs-adaptive": "4.1.6",
"botbuilder-dialogs-declarative": "4.1.6",
"botbuilder-dialogs-adaptive-runtime-core": "4.1.6",
"botbuilder-dialogs-declarative": "4.1.6",
"orchestrator-core": "4.13.1",
"uuid": "^8.3.2"
},
Expand All @@ -42,6 +42,7 @@
"build-docs": "typedoc --theme markdown --entryPoint botbuilder-ai-orchestrator --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\botbuilder-ai-orchestrator .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - Orchestrator\" --readme none",
"build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint . --ext .js,.ts",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"test": "yarn build && nyc mocha tests/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const { ok, strictEqual } = require('assert');
const sinon = require('sinon');
const { NullTelemetryClient } = require('botbuilder-core');
const { ActivityEx, NullTelemetryClient } = require('botbuilder-core');
const { BoolExpression } = require('adaptive-expressions');
const { asMessageActivity } = require('botframework-schema').ActivityEx;

const orchestratorIntentText = 'Hello, Orc!';

Expand Down Expand Up @@ -57,7 +56,7 @@ const getOrchestratorIntentProps = () => ({
});

const getExpectedProps = (activity, result, logPersonalInformation) => {
const text = asMessageActivity(activity).text;
const text = ActivityEx.asMessageActivity(activity).text;
const expectedProps = text === orchestratorIntentText ? getOrchestratorIntentProps() : {};

if (logPersonalInformation) {
Expand Down
1 change: 1 addition & 0 deletions libraries/botbuilder-ai-qna/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"scripts": {
"build": "tsc -b",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint . --ext .js,.ts",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum"
},
Expand Down
7 changes: 3 additions & 4 deletions libraries/botbuilder-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"dependencies": {
"@azure/cognitiveservices-luis-runtime": "2.0.0",
"@azure/ms-rest-js": "1.9.1",
"@microsoft/recognizers-text-date-time": "1.1.4",
"adaptive-expressions": "4.1.6",
"botbuilder-core": "4.1.6",
"botbuilder-dialogs": "4.1.6",
Expand All @@ -38,12 +37,11 @@
"botbuilder-stdlib": "4.1.6",
"lodash": "^4.17.21",
"node-fetch": "^2.6.0",
"runtypes": "~6.3.0",
"url-parse": "^1.5.1"
"url-parse": "^1.5.1",
"zod": "~1.11.17"
},
"devDependencies": {
"@types/node-fetch": "^2.5.7",
"dotenv": "^8.1.0",
"fs-extra": "^7.0.1",
"nock": "^11.9.1"
},
Expand All @@ -52,6 +50,7 @@
"build-docs": "typedoc --theme markdown --entryPoint botbuilder-ai --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\botbuilder-ai .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - AI\" --readme none",
"build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint . --ext .js,.ts",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"test": "npm-run-all build test:mocha",
Expand Down
Loading

0 comments on commit 542641d

Please sign in to comment.