Skip to content

Commit

Permalink
Prepare and generate typetests on main (#13029)
Browse files Browse the repository at this point in the history
I manually updated the npm scripts to call flub with the correct
arguments etc. Relevant changes:

- Uses the `--pin` argument to pin the version in package.json to the
maximum matching released version. This should help with the lockfile
issues we have discovered.
- All generated files now include `.generated` in their name and old
files were deleted. This was detected as a rename by git.

See #12849 or `typetestDetails.md` for documentation on semantics of
these changes.

Then I did the following steps to configure the baselines and generate
tests.

1. `npm run typetests:prepare -- -b main --reset` - this reset all type
test overrides and set the baseline versions according to the main
branch config. For the client release group this is `~previousMinor`,
which corresponds to version 2.0.0-internal.2.1.0.
2. `npm i` - installed new versions of packages.
3. `npm run typetests:gen -- -b main` - this regenerated the typetests.
4. Ran a build and added back broken test overrides as needed.
5. Disabled tests in some packages like PropertyDDS. 

I also did roughly the same steps for the independent packages.
  • Loading branch information
tylerbutler authored Nov 22, 2022
1 parent 586bd7f commit 7922001
Show file tree
Hide file tree
Showing 167 changed files with 1,327 additions and 1,072 deletions.
6 changes: 6 additions & 0 deletions build-tools/packages/build-cli/src/commands/check/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ export class CheckPolicy extends BaseCommand<typeof CheckPolicy.flags> {

async run() {
const handlersToRun: Handler[] = policyHandlers.filter((h) => {
if (
this.processedFlags.excludeHandler === undefined ||
this.processedFlags.excludeHandler.length === 0
) {
return true;
}
const shouldRun = this.processedFlags.excludeHandler?.includes(h.name) === false;
if (!shouldRun) {
this.info(`Excluding handler: ${h.name}`);
Expand Down
6 changes: 4 additions & 2 deletions common/lib/common-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
"tsc": "tsc",
"tsc:watch": "tsc --watch",
"typetests:gen": "flub generate typetests --generate --dir . --no-generateInName",
"typetests:prepare": "flub generate typetests --prepare --dir . --no-generateInName"
"typetests:gen": "flub generate typetests --generate --dir .",
"typetests:prepare": "flub generate typetests --prepare --dir ."
},
"dependencies": {},
"devDependencies": {
Expand All @@ -64,6 +64,8 @@
},
"typeValidation": {
"version": "1.0.0",
"baselineRange": "~0.20.1",
"baselineVersion": "0.20.1",
"broken": {}
}
}
7 changes: 4 additions & 3 deletions common/lib/common-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"test:mocha:report": "npm run test:mocha -- -- --reporter xunit --reporter-option output=nyc/mocha-junit-report.xml",
"test:report": "nyc npm run test:mocha:report && npm run test:jest:report",
"tsc": "tsc",
"typetests:gen": "flub generate typetests --generate --dir . --no-generateInName",
"typetests:prepare": "flub generate typetests --prepare --dir . --no-generateInName"
"typetests:gen": "flub generate typetests --generate --dir .",
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
},
"nyc": {
"all": true,
Expand Down Expand Up @@ -130,7 +130,8 @@
},
"typeValidation": {
"version": "1.1.0",
"baselineRange": "1.0.0",
"baselineRange": "~1.0.0",
"baselineVersion": "1.0.0",
"broken": {}
}
}
7 changes: 4 additions & 3 deletions common/lib/protocol-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"tsc:watch": "tsc --watch",
"tsfmt": "tsfmt --verify",
"tsfmt:fix": "tsfmt --replace",
"typetests:gen": "flub generate typetests --generate --dir . --no-generateInName",
"typetests:prepare": "flub generate typetests --prepare --dir . --no-generateInName"
"typetests:gen": "flub generate typetests --generate --dir .",
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
},
"dependencies": {
"@fluidframework/common-definitions": "^0.20.1"
Expand Down Expand Up @@ -67,7 +67,8 @@
},
"typeValidation": {
"version": "1.2.0",
"baselineRange": "1.1.0",
"baselineRange": "~1.1.0",
"baselineVersion": "1.1.0",
"broken": {}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"lint": "npm run eslint",
"lint:fix": "npm run eslint:fix",
"prepack": "npm run webpack",
"start": "npm run start:spo-df",
"start:spo": "node dist/expressApp.js --env mode=spo",
"start:spo-df": "node dist/expressApp.js --env mode=spo-df",
"start": "npm run start:spo-df",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
"dependencies": {
"@fluidframework/common-utils": "^1.0.0",
"@fluid-tools/fluidapp-odsp-urlresolver": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluidframework/common-utils": "^1.0.0",
"@fluidframework/odsp-doclib-utils": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluidframework/odsp-driver": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluidframework/odsp-driver-definitions": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
Expand Down Expand Up @@ -65,7 +65,6 @@
"typescript": "~4.5.5",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "~4.6.0",
"webpack-dev-middleware": "^5.3.3",
"webpack-hot-middleware": "^2.25.3",
"webpack-merge": "^5.8.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@babel/eslint-parser": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@fluid-experimental/property-binder-previous": "npm:@fluid-experimental/[email protected]",
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluidframework/test-utils": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
Expand Down Expand Up @@ -109,8 +110,10 @@
"outputName": "jest-junit-report.xml"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"traverse": "0.6.6"
},
"devDependencies": {
"@fluid-experimental/property-changeset-previous": "npm:@fluid-experimental/[email protected]",
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@rushstack/eslint-config": "^2.5.1",
Expand All @@ -88,8 +89,10 @@
"typescript": "~4.5.5"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"traverse": "0.6.6"
},
"devDependencies": {
"@fluid-experimental/property-common-previous": "npm:@fluid-experimental/[email protected]",
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/eslint-config-fluid": "^1.2.0",
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
Expand All @@ -87,8 +88,10 @@
"typescript": "~4.5.5"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {}
}
}
5 changes: 4 additions & 1 deletion experimental/PropertyDDS/packages/property-dds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
},
"devDependencies": {
"@fluid-experimental/property-common": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-experimental/property-dds-previous": "npm:@fluid-experimental/[email protected]",
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluidframework/eslint-config-fluid": "^1.2.0",
Expand All @@ -80,8 +81,10 @@
"typescript": "~4.5.5"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@fluid-experimental/property-binder": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-experimental/property-changeset": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-experimental/property-dds": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-experimental/property-inspector-table-previous": "npm:@fluid-experimental/[email protected]",
"@fluid-experimental/property-properties": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-experimental/property-proxy": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-tools/webpack-fluid-loader": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
Expand Down Expand Up @@ -117,8 +118,11 @@
"outputName": "jest-junit-report.xml"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"broken": {}
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {
}
}
}
8 changes: 6 additions & 2 deletions experimental/PropertyDDS/packages/property-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@babel/core": "^7.12.10",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@fluid-experimental/property-proxy-previous": "npm:@fluid-experimental/[email protected]",
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/eslint-config-fluid": "^1.2.0",
"@rushstack/eslint-config": "^2.5.1",
Expand All @@ -64,8 +65,11 @@
"outputName": "jest-junit-report.xml"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"broken": {}
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"devDependencies": {
"@fluid-experimental/property-properties": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"@fluid-experimental/property-query-previous": "npm:@fluid-experimental/[email protected]",
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
Expand All @@ -45,8 +46,10 @@
"sinon": "^7.4.2"
},
"typeValidation": {
"disabled": true,
"version": "2.0.0-internal.2.2.0",
"baselineRange": "2.0.0-internal.2.0.0",
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
"baselineVersion": "2.0.0-internal.2.1.0",
"broken": {}
}
}
4 changes: 2 additions & 2 deletions experimental/dds/sequence-deprecated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"test:mocha": "mocha --recursive dist/test/**/*.spec.js -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
"tsc": "tsc",
"typetests:gen": "flub generate typetests --generate --dir . --no-generateInName",
"typetests:prepare": "flub generate typetests --prepare --dir . --no-generateInName"
"typetests:gen": "flub generate typetests --generate --dir .",
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
},
"nyc": {
"all": true,
Expand Down
Loading

0 comments on commit 7922001

Please sign in to comment.