Skip to content

build(client): Add new end-to-end test package for tinylicious-client #24868

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion PACKAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ The dependencies between layers are enforced by the layer-check command._

| Packages | Layer Dependencies |
| --- | --- |
| - [@fluidframework/azure-end-to-end-tests](/packages/service-clients/end-to-end-tests/azure-client)</br>- [@fluid-experimental/odsp-end-to-end-tests](/packages/service-clients/end-to-end-tests/odsp-client)</br>- [@fluid-internal/functional-tests](/packages/test/functional-tests) (private)</br>- [@fluid-internal/local-server-stress-tests](/packages/test/local-server-stress-tests) (private)</br>- [@fluid-internal/local-server-tests](/packages/test/local-server-tests) (private)</br>- [@fluid-internal/mocha-test-setup](/packages/test/mocha-test-setup)</br>- [@fluid-internal/test-snapshots](/packages/test/snapshots) (private)</br>- [@fluid-private/test-end-to-end-tests](/packages/test/test-end-to-end-tests)</br>- [@fluid-internal/test-service-load](/packages/test/test-service-load)</br>- [@fluidframework/test-utils](/packages/test/test-utils)</br>- [@fluid-private/test-version-utils](/packages/test/test-version-utils)</br>- [@types/jest-environment-puppeteer](/packages/test/types_jest-environment-puppeteer) (private)</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp; | - [Core-Interfaces](#Core-Interfaces)</br>- [Driver-Definitions](#Driver-Definitions)</br>- [Container-Definitions](#Container-Definitions)</br>- [Core-Utils](#Core-Utils)</br>- [Client-Utils](#Client-Utils)</br>- [Telemetry-Utils](#Telemetry-Utils)</br>- [Driver-Utils](#Driver-Utils)</br>- [Other-Utils](#Other-Utils)</br>- [Tool-Utils](#Tool-Utils)</br>- [Driver](#Driver)</br>- [Loader](#Loader)</br>- [Runtime](#Runtime)</br>- [Framework](#Framework)</br>- [Build](#Build)</br>- [Server-Libs](#Server-Libs)</br>- [Server-Tools](#Server-Tools)</br>- [Routerlicious-Driver](#Routerlicious-Driver)</br>- [Test-Utils](#Test-Utils)</br>- [ServiceClients](#ServiceClients)</br>- [Tools](#Tools) |
| - [@fluidframework/azure-end-to-end-tests](/packages/service-clients/end-to-end-tests/azure-client)</br>- [@fluid-experimental/odsp-end-to-end-tests](/packages/service-clients/end-to-end-tests/odsp-client)</br>- [@fluid-private/tinylicious-end-to-end-tests](/packages/service-clients/end-to-end-tests/tinylicious-client) (private)</br>- [@fluid-internal/functional-tests](/packages/test/functional-tests) (private)</br>- [@fluid-internal/local-server-stress-tests](/packages/test/local-server-stress-tests) (private)</br>- [@fluid-internal/local-server-tests](/packages/test/local-server-tests) (private)</br>- [@fluid-internal/mocha-test-setup](/packages/test/mocha-test-setup)</br>- [@fluid-internal/test-snapshots](/packages/test/snapshots) (private)</br>- [@fluid-private/test-end-to-end-tests](/packages/test/test-end-to-end-tests)</br>- [@fluid-internal/test-service-load](/packages/test/test-service-load)</br>- [@fluidframework/test-utils](/packages/test/test-utils)</br>- [@fluid-private/test-version-utils](/packages/test/test-version-utils)</br>- [@types/jest-environment-puppeteer](/packages/test/types_jest-environment-puppeteer) (private)</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp;</br>&nbsp; | - [Core-Interfaces](#Core-Interfaces)</br>- [Driver-Definitions](#Driver-Definitions)</br>- [Container-Definitions](#Container-Definitions)</br>- [Core-Utils](#Core-Utils)</br>- [Client-Utils](#Client-Utils)</br>- [Telemetry-Utils](#Telemetry-Utils)</br>- [Driver-Utils](#Driver-Utils)</br>- [Other-Utils](#Other-Utils)</br>- [Tool-Utils](#Tool-Utils)</br>- [Driver](#Driver)</br>- [Loader](#Loader)</br>- [Runtime](#Runtime)</br>- [Framework](#Framework)</br>- [Build](#Build)</br>- [UberPackage](#UberPackage)</br>- [Server-Libs](#Server-Libs)</br>- [Server-Tools](#Server-Tools)</br>- [Routerlicious-Driver](#Routerlicious-Driver)</br>- [Test-Utils](#Test-Utils)</br>- [ServiceClients](#ServiceClients)</br>- [Tools](#Tools) |

### Azure-Examples

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/

module.exports = {
extends: [require.resolve("@fluidframework/eslint-config-fluid"), "prettier"],
rules: {
"prefer-arrow-callback": "off",
"@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig
},
overrides: [
{
// Rules only for test files
files: ["*.spec.ts", "*.test.ts", "**/test/**"],
rules: {
// Some deprecated APIs are permissible in tests; use `warn` to keep them visible
"import/no-deprecated": "warn",
},
},
],
parserOptions: {
project: ["./src/test/tsconfig.json"],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Compiled TypeScript and CSS
dist
lib

# Babel
public/scripts/es5

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
.cache-loader

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Typings
typings

# Debug log from npm
npm-debug.log

# Code coverage
nyc
.nyc_output/

# Chart dependencies
**/charts/*.tgz

# Generated modules
intel_modules/
temp_modules/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nyc
*.log
**/*.tsbuildinfo
**/_api-extractor-temp/**
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @fluid-private/tinylicious-end-to-end-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation and contributors. All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @fluid-private/tinylicious-end-to-end-tests

Functional end-to-end tests for Tinylicious and tinylicious-client.

<!-- AUTO-GENERATED-CONTENT:START (README_FOOTER) -->

<!-- prettier-ignore-start -->
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->

## Contribution Guidelines

There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.

- Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
- [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).

Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.

## Help

Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).

Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).

Thank you!

## Trademark

This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.

Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).

Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.

<!-- prettier-ignore-end -->

<!-- AUTO-GENERATED-CONTENT:END -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["../../../../biome.jsonc"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"name": "@fluid-private/tinylicious-end-to-end-tests",
"version": "2.43.0",
"private": true,
"description": "Tinylicious client end to end tests",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "packages/service-clients/end-to-end-tests/tinylicious-client"
},
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"type": "module",
"scripts": {
"build": "fluid-build . --task build",
"build:compile": "fluid-build . --task compile",
"build:test": "tsc --project ./src/test/tsconfig.json",
"check:biome": "biome check .",
"check:format": "npm run check:biome",
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" nyc",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run format:biome",
"format:biome": "biome check . --write",
"lint": "fluid-build . --task lint",
"lint:fix": "fluid-build . --task eslint:fix --task format",
"test:coverage": "c8 npm test",
"test:disabled": "cross-env logger__level=crit start-server-and-test tinylicious 7070 test:mocha",
"test:mocha": "mocha --recursive \"lib/test/**/*.spec.*js\" --config src/test/.mocharc.cjs --exit",
"test:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm test",
"tinylicious": "tinylicious"
},
"c8": {
"all": true,
"cache-dir": "nyc/.cache",
"exclude": [
"src/test/**/*.*ts",
"lib/test/**/*.*js"
],
"exclude-after-remap": false,
"include": [
"src/**/*.*ts",
"lib/**/*.*js"
],
"report-dir": "nyc/report",
"reporter": [
"cobertura",
"html",
"text"
],
"temp-directory": "nyc/.nyc_output"
},
"dependencies": {
"@fluid-experimental/data-objects": "workspace:~",
"@fluid-internal/client-utils": "workspace:~",
"@fluid-internal/mocha-test-setup": "workspace:~",
"@fluid-private/test-version-utils": "workspace:~",
"@fluidframework/aqueduct": "workspace:~",
"@fluidframework/container-definitions": "workspace:~",
"@fluidframework/container-loader": "workspace:~",
"@fluidframework/core-interfaces": "workspace:~",
"@fluidframework/driver-definitions": "workspace:~",
"@fluidframework/fluid-static": "workspace:~",
"@fluidframework/presence": "workspace:~",
"@fluidframework/runtime-definitions": "workspace:~",
"@fluidframework/test-runtime-utils": "workspace:~",
"@fluidframework/test-utils": "workspace:~",
"@fluidframework/tinylicious-client": "workspace:~",
"cross-env": "^7.0.3",
"fluid-framework": "workspace:~",
"mocha": "^10.8.2",
"mocha-multi-reporters": "^1.5.1",
"sinon": "^18.0.1",
"start-server-and-test": "^2.0.3",
"tinylicious": "^5.0.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@biomejs/biome": "~1.9.3",
"@fluidframework/build-common": "^2.0.3",
"@fluidframework/build-tools": "^0.55.0",
"@fluidframework/eslint-config-fluid": "^5.7.4",
"@types/mocha": "^10.0.10",
"@types/node": "^18.19.0",
"@types/sinon": "^17.0.3",
"@types/uuid": "^9.0.2",
"c8": "^8.0.1",
"eslint": "~8.55.0",
"rimraf": "^4.4.0",
"typescript": "~5.4.5"
},
"fluidBuild": {
"tasks": {
"build:test": [
"^api-extractor:esnext",
"^build:esnext",
"^tsc"
]
}
},
"typeValidation": {
"disabled": true,
"broken": {},
"entrypoint": "internal"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/

"use strict";

const packageDir = `${__dirname}/../..`;
const getFluidTestMochaConfig = require("@fluid-private/test-version-utils/mocharc-common");
const config = getFluidTestMochaConfig(packageDir);

module.exports = config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/

import type { ScopeType } from "@fluidframework/driver-definitions/internal";
import { InsecureTokenProvider } from "@fluidframework/test-runtime-utils/internal";
import {
TinyliciousClient,
type TinyliciousConnectionConfig,
} from "@fluidframework/tinylicious-client";
import { v4 as uuid } from "uuid";

/**
* TODO
*/
export function createTinyliciousClient(
id?: string,
name?: string,
scopes?: ScopeType[],
): TinyliciousClient {
const user = {
id: id ?? uuid(),
name: name ?? uuid(),
};
const connectionProps: TinyliciousConnectionConfig = {
tokenProvider: new InsecureTokenProvider("fooBar", user, scopes),
};

return new TinyliciousClient({
connection: connectionProps,
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../../../../../common/build/build-common/tsconfig.test.node16.json",
"compilerOptions": {
"rootDir": "./",
"outDir": "../../lib/test",
"types": ["mocha", "node"],
"noUnusedLocals": true,
},
"include": ["./**/*"],
}
Loading
Loading