Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect coverage report #87

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion citizen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export const issueFirstClassCitizenship = async (
// Initialize the simnet, to generate the simnet plan and instance. The empty
// session will be set up, and contracts will be deployed in the correct
// order based on the simnet plan a few lines below.
const simnet = await initSimnet(manifestPath);
const simnet = await initSimnet(manifestPath, false, {
trackCosts: false,
trackCoverage: true,
});

const simnetPlan = yaml.parse(
readFileSync(join(manifestDir, "deployments", "default.simnet-plan.yaml"), {
Expand Down
7 changes: 6 additions & 1 deletion heatstroke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@
import { green } from "ansicolor";
import { EventEmitter } from "events";
import { getContractNameFromContractId } from "./shared";
import { Simnet } from "@hirosystems/clarinet-sdk";

export function reporter(
//@ts-ignore
runDetails,
radio: EventEmitter,
type: "invariant" | "test"
type: "invariant" | "test",
simnet: Simnet
) {
const report = simnet.collectReport(false, "");
console.log(report.coverage);

if (runDetails.failed) {
// Report general run data.
const r = runDetails.counterexample[0];
Expand Down
2 changes: 1 addition & 1 deletion invariant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const checkInvariants = (
}

const radioReporter = (runDetails: any) => {
reporter(runDetails, radio, "invariant");
reporter(runDetails, radio, "invariant", simnet);
};

fc.assert(
Expand Down
2 changes: 1 addition & 1 deletion property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const checkProperties = (
}

const radioReporter = (runDetails: any) => {
reporter(runDetails, radio, "test");
reporter(runDetails, radio, "test", simnet);
};

fc.assert(
Expand Down
Loading