Skip to content

Commit

Permalink
feat: track hw events for coqnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Namaskar-1F64F committed Feb 17, 2025
1 parent af42106 commit f660be2
Show file tree
Hide file tree
Showing 15 changed files with 840 additions and 210 deletions.
122 changes: 117 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"ts-node": "^10.9.1",
"typescript": "^5.3.3",
"vite": "^4.2.1",
"vitest": "^1.0.2"
"vitest": "^1.0.2",
"@slack/webhook": "^7.0.4"
},
"scripts": {
"test": "export NODE_ENV=development && vitest --ui",
"deploy": "tenderly actions deploy"
}
}
}
36 changes: 36 additions & 0 deletions src/actions-local/coqnet.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { TestRuntime } from "@tenderly/actions-test";
import { config } from "dotenv";

import { beforeAll, describe, test } from "vitest";

import { coqnetHardwareRented } from "../actions/coqnet";
import { Network } from "@tenderly/actions";

config();

describe("Coqnet Hardware Provider", () => {
const testRuntime = new TestRuntime();
beforeAll(() => {
for (const [key, value] of Object.entries(process.env)) {
if (value) {
testRuntime.context.secrets.put(key, value);
}
}
});
describe("Hardware Rented", () => {
test.concurrent("hardware rented event", async () => {
testRuntime.context.metadata.getNetwork = () => Network.FUJI;
await testRuntime.execute(
coqnetHardwareRented,
require("./payload/payload-coqnet-artifact-rented.json")
);
});
test.concurrent("hardware rented event", async () => {
testRuntime.context.metadata.getNetwork = () => Network.FUJI;
await testRuntime.execute(
coqnetHardwareRented,
require("./payload/payload-coqnet-chorusone-rented.json")
);
});
});
});
146 changes: 0 additions & 146 deletions src/actions-local/payload/payload-artifact-rented-new-fuji.json

This file was deleted.

Loading

0 comments on commit f660be2

Please sign in to comment.