From b75e7c34762d548c02ac5a702d6e48f8b228d91b Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 30 May 2024 17:40:22 +0300 Subject: [PATCH 01/13] Add compute capacity unit tests --- .../tests/modules/compute_capacity.test.ts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packages/grid_client/tests/modules/compute_capacity.test.ts diff --git a/packages/grid_client/tests/modules/compute_capacity.test.ts b/packages/grid_client/tests/modules/compute_capacity.test.ts new file mode 100644 index 0000000000..fe1d31f498 --- /dev/null +++ b/packages/grid_client/tests/modules/compute_capacity.test.ts @@ -0,0 +1,60 @@ +import { ComputeCapacity } from "../../src"; + +let computeCapacity: ComputeCapacity; + +beforeEach(() => { + computeCapacity = new ComputeCapacity(); +}); +describe("Compute Capacity module", () => { + test("Compute Capacity instance is of type ComputeCapacity.", () => { + expect(computeCapacity).toBeInstanceOf(ComputeCapacity); + }); + + test("Min values for cpu & memory.", () => { + const cpu = 0; + const mem = 255 * 1024 ** 2; + + computeCapacity.cpu = cpu; + computeCapacity.memory = mem; + + const result = () => computeCapacity.challenge(); + + expect(result).toThrow(); + }); + + test("Max values for cpu & memory.", () => { + const cpu = 33; + const mem = 255 * 1024 ** 4; + + computeCapacity.cpu = cpu; + computeCapacity.memory = mem; + + const result = () => computeCapacity.challenge(); + + expect(result).toThrow(); + }); + + test("cpu & memory doesn't accept decimal values.", () => { + const cpu = 1.5; + const mem = 1.2; + + computeCapacity.cpu = cpu; + computeCapacity.memory = mem; + + const result = () => computeCapacity.challenge(); + + expect(result).toThrow(); + }); + + test("An error should be thrown if cpu & memory negative values.", () => { + const negative_cpu = -1; + const negative_mem = -1; + + computeCapacity.cpu = negative_cpu; + computeCapacity.memory = negative_mem; + + const result = () => computeCapacity.challenge(); + + expect(result).toThrow(); + }); +}); From 73ca47223ef63bef9017d86d4e8301d443caa35f Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 30 May 2024 17:53:28 +0300 Subject: [PATCH 02/13] Test cpu & mem empty values --- packages/grid_client/tests/modules/compute_capacity.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/grid_client/tests/modules/compute_capacity.test.ts b/packages/grid_client/tests/modules/compute_capacity.test.ts index fe1d31f498..08c0de91b9 100644 --- a/packages/grid_client/tests/modules/compute_capacity.test.ts +++ b/packages/grid_client/tests/modules/compute_capacity.test.ts @@ -46,6 +46,12 @@ describe("Compute Capacity module", () => { expect(result).toThrow(); }); + test("cpu & memory empty values.", () => { + const result = () => computeCapacity.challenge(); + + expect(result).toThrow(); + }); + test("An error should be thrown if cpu & memory negative values.", () => { const negative_cpu = -1; const negative_mem = -1; From 88244ede2f494e381b514a8fedd6d13ef39af2d1 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Wed, 12 Jun 2024 10:32:46 +0300 Subject: [PATCH 03/13] Update grid client version in nightly workflow --- .github/workflows/grid_client_nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index c6f40644d9..417cd45885 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 if: ${{ env.NETWORK == 'qa' }} with: - ref: refs/tags/v2.4.3 + ref: refs/tags/v2.5.0-rc2 - uses: actions/checkout@v4 if: ${{ env.NETWORK == 'test' }} with: From b5fde6b5460189494d4362e5310a0a22b6303437 Mon Sep 17 00:00:00 2001 From: kassem Date: Wed, 12 Jun 2024 15:52:25 +0300 Subject: [PATCH 04/13] Fix: reload gateway nodes - add reload node logic, and reset the gateway field --- .../components/node_selector/TfDomainName.vue | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/playground/src/components/node_selector/TfDomainName.vue b/packages/playground/src/components/node_selector/TfDomainName.vue index 432058b470..56d38bb7cf 100644 --- a/packages/playground/src/components/node_selector/TfDomainName.vue +++ b/packages/playground/src/components/node_selector/TfDomainName.vue @@ -52,7 +52,7 @@