Skip to content

Commit

Permalink
Adding features to tests, corrects mispelled words and hiding wiregua…
Browse files Browse the repository at this point in the history
…rd in deployement data in case of zmachine light
  • Loading branch information
maayarosama committed Dec 29, 2024
1 parent 75f257e commit 719ebf1
Show file tree
Hide file tree
Showing 16 changed files with 151 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/grid_client/docs/deployment_flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const vms: MachinesModel = {
- The next step is invoking the `deploy` function:
- Takes the `MachinesModel` object as a parameter
- Checks if a machine with the same name already exists and if so throws an error
- If not it calls the `_createDeployment` function along some othe functions
- Finally it returns the created contracts and the wiregaurd configuration
- If not, then it calls the `_createDeployment` function along some othe functions
- Finally it returns the created contracts and the wireguard configuration, in case of zos4 node the wireguard configuration is returned empty

```ts
await client.machines.deploy(vms);
Expand All @@ -81,7 +81,7 @@ await this._createDeployment(options);
- Configures the VM with networking, storage, and environment variables.
- Generates a Mycelium seed if not provided.
- Generate the deployments
- Returns the deployments and wiregaurd configurations
- Returns the deployments and wiregaurd configurations and in case of zos4 node the wiregaurd configuration is returned empty

```ts
await this.vm.create(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2683 - Applications: Deploy Casperlabs", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ import { Buffer } from "buffer";
import { setTimeout } from "timers/promises";
import TweetNACL from "tweetnacl";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -85,6 +93,7 @@ test.skip("TC2690 - Applications: Deploy Discourse", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.ip, Features.ipv4, Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2685 - Applications: Deploy Funkwhale", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2689 - Applications: Deploy Mattermost", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.ip, Features.ipv4, Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2692 - Applications: Deploy Nextcloud", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import { Features, FilterOptions, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -67,6 +67,7 @@ test.skip("TC2701 - Applications: Deploy Nodepilot", async () => {
farmId: 1,
publicIPs: publicIp,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.ip, Features.ipv4, Features.wireguard],
status: "up",
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
Expand Down
11 changes: 10 additions & 1 deletion packages/grid_client/tests/modules/applications/peertube.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2684 - Applications: Deploy Peertube", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
11 changes: 10 additions & 1 deletion packages/grid_client/tests/modules/applications/subsquid.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2693 - Applications: Deploy Subsquid", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
11 changes: 10 additions & 1 deletion packages/grid_client/tests/modules/applications/taiga.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2691 - Applications: Deploy Taiga", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../../src";
import { config, getClient } from "../../client_loader";
import { GBToBytes, generateInt, getOnlineNode, log, splitIP } from "../../utils";

Expand Down Expand Up @@ -78,6 +86,7 @@ test("TC2700 - Applications: Deploy Wordpress", async () => {
sru: rootfsSize + diskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
const nodeId = await getOnlineNode(nodes);
if (nodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
11 changes: 10 additions & 1 deletion packages/grid_client/tests/modules/gateways.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import axios from "axios";
import { setTimeout } from "timers/promises";

import { FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel, randomChoice } from "../../src";
import {
Features,
FilterOptions,
GatewayNameModel,
generateString,
GridClient,
MachinesModel,
randomChoice,
} from "../../src";
import { config, getClient } from "../client_loader";
import { generateInt, getOnlineNode, log, splitIP } from "../utils";

Expand Down Expand Up @@ -115,6 +123,7 @@ test("TC1237 - Gateways: Expose a VM Over Gateway", async () => {
gateway: true,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.gatewayfqdnproxy, Features.gatewaynameproxy],
} as FilterOptions);
const gatewayNodeId = await getOnlineNode(gatewayNodes);
if (gatewayNodeId == -1) throw new Error("no nodes available to complete this test");
Expand Down
13 changes: 13 additions & 0 deletions packages/grid_client/tests/modules/kubernetes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
AddWorkerModel,
DeleteWorkerModel,
Features,
FilterOptions,
generateString,
GridClient,
Expand Down Expand Up @@ -75,6 +76,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
sru: masterRootfsSize + masterDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
} catch (error) {
//Log the resources that were not found.
Expand All @@ -94,6 +96,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
sru: masterRootfsSize + masterDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
}

Expand All @@ -106,6 +109,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
sru: workerRootfsSize + workerDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
} catch (error) {
//Log the resources that were not found.
Expand All @@ -125,6 +129,7 @@ test("TC1231 - Kubernetes: Deploy a Kubernetes Cluster", async () => {
sru: workerRootfsSize + workerDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
}
const masterNodeId = await getOnlineNode(masterNode);
Expand Down Expand Up @@ -343,6 +348,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
sru: masterRootfsSize + masterDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
} catch (error) {
//Log the resources that were not found.
Expand All @@ -362,6 +368,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
sru: masterRootfsSize + masterDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
}

Expand All @@ -374,6 +381,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
sru: (workerRootfsSize + workerDiskSize) * 2,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
} catch (error) {
//Log the resources that were not found.
Expand All @@ -393,6 +401,7 @@ test("TC1232 - Kubernetes: Add Worker", async () => {
sru: (workerRootfsSize + workerDiskSize) * 2,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
}
const masterNodeId = await getOnlineNode(masterNode);
Expand Down Expand Up @@ -599,6 +608,7 @@ test("TC1233 - Kubernetes: Delete Worker", async () => {
sru: masterRootfsSize + masterDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
} catch (error) {
//Log the resources that were not found.
Expand All @@ -618,6 +628,7 @@ test("TC1233 - Kubernetes: Delete Worker", async () => {
sru: masterRootfsSize + masterDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
}

Expand All @@ -630,6 +641,7 @@ test("TC1233 - Kubernetes: Delete Worker", async () => {
sru: workerRootfsSize + workerDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
} catch (error) {
//Log the resources that were not found.
Expand All @@ -649,6 +661,7 @@ test("TC1233 - Kubernetes: Delete Worker", async () => {
sru: workerRootfsSize + workerDiskSize,
farmId: 1,
availableFor: await gridClient.twins.get_my_twin_id(),
features: [Features.wireguard],
} as FilterOptions);
}
const masterNodeId = await getOnlineNode(masterNode);
Expand Down
Loading

0 comments on commit 719ebf1

Please sign in to comment.