Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

fix(tests): Repair integration tests [fixes DXJ-506] #364

Merged
merged 5 commits into from
Oct 18, 2023
Merged

Conversation

akim-bow
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Oct 17, 2023

@@ -22,6 +23,12 @@ const test = async () => {
await symlink(CDN_PUBLIC_PATH, join(publicPath, "source"));
}

try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please document what happens here and why?

Also, is it platform dependent in any way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored it to self descriptive function.

Yes, it's platform independent

Comment on lines 43 to 47
try {
await access(join(publicPath, "deps"));
} catch {
await symlink(JS_CLIENT_DEPS_PATH, join(publicPath, "deps"));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move that to a separate function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@@ -42,7 +41,7 @@ export interface CallAquaFunctionArgs {
/**
* Peer to call the function on
*/
peer: IFluenceInternalApi;
peer: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a little weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be refactored and moved to JS-client. Previous type was essentially the same. I will add TODO to remember this.

@@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Node } from "./commonTypes.js";
import type { Node } from "@fluencelabs/interfaces";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that refer to a published library, or to a local path?

If it refers to a published library, you might have bad time updating these types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to js-client side.

export async function fetchResource(
pkg: string,
assetPath: string,
root: string,
Copy link
Contributor

@folex folex Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is root? need some doc

export async function fetchResource(
pkg: string,
assetPath: string,
root: string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

assetPath: string,
root: string,
) {
// `root` will be handled somehow in the future. For now, we use filesystem root where js-client is running;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// `root` will be handled somehow in the future. For now, we use filesystem root where js-client is running;
// TODO: `root` will be handled somehow in the future. For now, we use filesystem root where js-client is running;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Copy link
Contributor

@folex folex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand what happens here.

What's the purpose of intefaces library if it doesn't hold all the public interfaces?

@@ -85,7 +85,9 @@ const getRelayTime = () => {

const main = async () => {
console.log("starting fluence...");
fluence.defaultClient = await fluence.clientFactory(relay, {});
fluence.defaultClient = await fluence.clientFactory(relay, {
CDNUrl: "http://localhost:3000",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will URL be reported in an error, if it is not available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will give you runtime error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS-client will throw when you try to run it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will the error message include URL? I think it should

@akim-bow
Copy link
Contributor Author

akim-bow commented Oct 17, 2023

I don't really understand what happens here.

What's the purpose of intefaces library if it doesn't hold all the public interfaces?

My vision on @fluencelabs/interface is that is should be private in our ecosystem. It should contain very generic types for reusing between avm , marine-js, marine-worker, aqua-to-js and other packages in our ecosystem. Thus I dont see a reason to keep js-client's config type in there

/**
* Node of the Fluence network specified as a pair of node's multiaddr and it's peer id
*/
export type Node = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename since it's private now? like, Peer or something

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants