-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix gpu validation + add tests * fix equal error * fix validation + added better tests * fix test snapshot name
- Loading branch information
Showing
7 changed files
with
152 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: "2.0" | ||
services: | ||
web: | ||
image: nginx | ||
expose: | ||
- port: 80 | ||
accept: | ||
- ahostname.com | ||
to: | ||
- global: true | ||
- port: 12345 | ||
to: | ||
- global: true | ||
proto: udp | ||
profiles: | ||
compute: | ||
web: | ||
resources: | ||
cpu: | ||
units: "100m" | ||
gpu: | ||
units: 1 | ||
attributes: | ||
vendor: | ||
nvidia: | ||
memory: | ||
size: "128Mi" | ||
storage: | ||
- size: "1Gi" | ||
placement: | ||
westcoast: | ||
attributes: | ||
region: us-west | ||
foo: bar | ||
signedBy: | ||
anyOf: | ||
- 1 | ||
- 2 | ||
allOf: | ||
- 3 | ||
- 4 | ||
pricing: | ||
web: | ||
denom: uakt | ||
amount: 50 | ||
deployment: | ||
web: | ||
westcoast: | ||
profile: web | ||
count: 2 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: "2.0" | ||
services: | ||
web: | ||
image: nginx | ||
expose: | ||
- port: 80 | ||
accept: | ||
- ahostname.com | ||
to: | ||
- global: true | ||
- port: 12345 | ||
to: | ||
- global: true | ||
proto: udp | ||
profiles: | ||
compute: | ||
web: | ||
resources: | ||
cpu: | ||
units: "100m" | ||
gpu: | ||
units: 1 | ||
attributes: | ||
vendor: | ||
invalidvendor: | ||
memory: | ||
size: "128Mi" | ||
storage: | ||
- size: "1Gi" | ||
placement: | ||
westcoast: | ||
attributes: | ||
region: us-west | ||
foo: bar | ||
signedBy: | ||
anyOf: | ||
- 1 | ||
- 2 | ||
allOf: | ||
- 3 | ||
- 4 | ||
pricing: | ||
web: | ||
denom: uakt | ||
amount: 50 | ||
deployment: | ||
web: | ||
westcoast: | ||
profile: web | ||
count: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import fs from "fs"; | ||
|
||
import { SDL } from "../src/sdl"; | ||
|
||
describe("test sdl gpu invalid vendor", () => { | ||
it("SDL: GPU must throw if the vendor is invalid", () => { | ||
const invalidSDL = fs.readFileSync("./tests/fixtures/gpu_invalid_vendor.sdl.yml", "utf8"); | ||
|
||
const t = () => { | ||
SDL.fromString(invalidSDL, "beta3"); | ||
}; | ||
|
||
expect(t).toThrow(`GPU must be one of the supported vendors (nvidia,amd).`); | ||
}); | ||
|
||
it("SDL: GPU without vendor name should throw", () => { | ||
const invalidSDL = fs.readFileSync("./tests/fixtures/gpu_invalid_no_vendor_name.sdl.yml", "utf8"); | ||
|
||
const t = () => { | ||
SDL.fromString(invalidSDL, "beta3"); | ||
}; | ||
|
||
expect(t).toThrow(`GPU must be one of the supported vendors (nvidia,amd).`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters