Skip to content

Commit

Permalink
Remove workspace dependency from CHIP testing (#1559)
Browse files Browse the repository at this point in the history
Previously CHIP testing would only work when run from within the a matter.js git clone.  Now it should work from installed packages as well.
  • Loading branch information
lauckhart authored Dec 25, 2024
1 parent 9a76017 commit e22bd24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/testing/src/chip/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Package } from "#tools";
import { resolve } from "path";
import { env } from "process";

/**
Expand Down Expand Up @@ -54,8 +52,7 @@ export namespace Constants {
export const initTimeout = 60_000;
export const defaultTimeoutMs = 60_000;

export const matterJsRoot = Package.workspace.path;
export const localPicsOverrideFile = resolve(matterJsRoot, "packages/testing/src/chip/matter-js-pics.properties");
export const localPicsOverrideFile = "src/chip/matter-js-pics.properties";

/**
* We set the commissioning timeout value very low because this timeout is tested and waiting the default 180s.
Expand Down
4 changes: 3 additions & 1 deletion packages/testing/src/chip/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Package } from "#tools";
import { BackchannelCommand } from "../device/backchannel.js";
import { Subject } from "../device/subject.js";
import { Test } from "../device/test.js";
Expand Down Expand Up @@ -408,7 +409,8 @@ async function configurePics() {
const ciPics = await State.container.read(ContainerPaths.chipPics);
const pics = new PicsFile(ciPics, true);

const overrides = new PicsFile(Constants.localPicsOverrideFile);
const testing = Package.tools.findPackage("@matter/testing");
const overrides = new PicsFile(testing.resolve(Constants.localPicsOverrideFile));
pics.patch(overrides);

Values.maybePics = pics;
Expand Down

0 comments on commit e22bd24

Please sign in to comment.