Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit 9e4a9b2

Browse files
committed
working InstallAppRequest and change pause duration for passing SM entry type CRUD tests
1 parent b1c0433 commit 9e4a9b2

File tree

2 files changed

+21
-40
lines changed

2 files changed

+21
-40
lines changed

src/sensemaker_dna/sensemaker/neighbourhood.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ export default () => {
105105
});
106106
};
107107
try {
108+
const pauseDuration = 1000;
108109
await scenario.shareAllAgents();
109-
await pause(500);
110+
await pause(pauseDuration);
110111

111112
// create an entry type in the provider DNA
112113
const createPost = {
@@ -119,8 +120,9 @@ export default () => {
119120
createPost
120121
);
121122
t.ok(createPostEntryHash);
123+
console.log('post hash', createPostEntryHash)
122124

123-
await pause(500);
125+
await pause(pauseDuration);
124126

125127
// Bob gets the created post
126128
const readPostOutput: Record = await callZomeBob(
@@ -171,7 +173,7 @@ export default () => {
171173
);
172174
t.ok(createDimensionEntryHash2);
173175
// Wait for the created entry to be propagated to the other node.
174-
await pause(100);
176+
await pause(pauseDuration);
175177

176178
// Bob gets the created dimension
177179
const createReadOutput: Record = await callZomeBob(
@@ -220,7 +222,7 @@ export default () => {
220222
t.ok(createResourceTypeEntryHash);
221223

222224
// Wait for the created entry to be propagated to the other node.
223-
await pause(100);
225+
await pause(pauseDuration);
224226

225227
// Bob gets the created resource type
226228
const createResourceTypeReadOutput: Record = await callZomeBob(
@@ -253,7 +255,7 @@ export default () => {
253255
t.ok(createAssessmentEntryHash);
254256

255257
// Wait for the created entry to be propagated to the other node.
256-
await pause(100);
258+
await pause(pauseDuration);
257259

258260
// create a second assessment on the Post
259261
const createAssessment2 = {
@@ -272,7 +274,7 @@ export default () => {
272274
t.ok(createAssessmentEntryHash2);
273275

274276
// Wait for the created entry to be propagated to the other node.
275-
await pause(100);
277+
await pause(pauseDuration);
276278

277279
// Bob gets the created assessment
278280
const createAssessmentReadOutput: Record = await callZomeBob(
@@ -345,7 +347,7 @@ export default () => {
345347
);
346348
t.ok(createMethodEntryHash);
347349

348-
await pause(100);
350+
await pause(pauseDuration);
349351

350352
// Bob gets the created method
351353
const createMethodReadOutput: Record = await callZomeBob(
@@ -373,7 +375,7 @@ export default () => {
373375
);
374376
t.ok(runMethodOutput);
375377

376-
await pause(100);
378+
await pause(pauseDuration);
377379

378380
const readObjectiveAssessmentOutput: Record = await callZomeBob(
379381
"sensemaker",

src/utils.ts

+11-32
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export const installAgent = async (
4040
try {
4141
const admin = conductor.adminWs();
4242

43-
const sensemakerLocation = pathToFileURL(sensemakerDna);
4443
console.log(`generating key for: ${agentName}:`);
4544
agent_key = await admin.generateAgentPubKey();
45+
4646
const req: InstallAppRequest = {
4747
installed_app_id: `${agentName}_sensemaker`,
4848
agent_key,
@@ -54,63 +54,42 @@ export const installAgent = async (
5454
description: "",
5555
roles: [{
5656
name: "sensemaker_dna",
57-
// provisioning: {
58-
// create: {
59-
// deferred: false,
60-
// }
61-
// },
6257
provisioning: {
6358
//@ts-ignore
6459
strategy: 'create',
6560
deferred: false,
6661
},
6762
dna: {
68-
// modifiers: {
69-
properties: {
70-
community_activator: ca_key
71-
? serializeHash(ca_key)
72-
: serializeHash(agent_key),
73-
config: with_config ? sampleConfig(resource_base_type!) : null
63+
//@ts-ignore
64+
modifiers: {
65+
properties: {
66+
community_activator: ca_key
67+
? serializeHash(ca_key)
68+
: serializeHash(agent_key),
69+
config: with_config ? sampleConfig(resource_base_type!) : null
70+
},
7471
},
75-
// },
76-
// location: sensemakerDna,
77-
// location: sensemakerLocation,
78-
// location: {
7972
//@ts-ignore
8073
path: sensemakerDna,
81-
// }
82-
// path: sensemakerDna,
8374
}
8475
}, {
8576
name: "test_provider_dna",
86-
// provisioning: {
87-
// create: {
88-
// deferred: false,
89-
// }
90-
// },
9177
provisioning: {
9278
//@ts-ignore
9379
strategy: 'create',
9480
deferred: false,
9581
},
9682
dna: {
97-
// location: testProviderDna,
98-
// location: {
99-
//@ts-ignore
100-
path: testProviderDna,
101-
// }
83+
//@ts-ignore
84+
path: testProviderDna,
10285
}
10386
}],
10487
},
10588
resources: {},
10689
}
10790
};
108-
console.log(`installing happ for: ${agentName}`);
10991
//@ts-ignore
11092
const agentHapp: AppInfo = await admin.installApp(req);
111-
console.log("++++++++ ======== ++++++++")
112-
console.log('agent happ', agentHapp)
113-
console.log("++++++++ ======== ++++++++")
11493
const ssCellInfo = agentHapp.cell_info["sensemaker_dna"][0]
11594
ss_cell_id = ("Provisioned" in ssCellInfo) ? ssCellInfo.Provisioned.cell_id : ss_cell_id
11695
const providerCellInfo = agentHapp.cell_info["test_provider_dna"][0]

0 commit comments

Comments
 (0)