Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Addresses all review comments from PR #28 covering mock data generation, test reliability, and build optimization.

Mock hash generation

  • Use crypto.randomBytes(32) instead of Math.random() to avoid potential leading zeros in hex strings
  • Remove unused destructured variables (priority, userId, circuitType)
// Before
hash: `0x${Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join('')}`

// After  
hash: `0x${crypto.randomBytes(32).toString('hex')}`

E2E test reliability

  • Move page.on("pageerror") before page.goto() to capture errors during page load
  • Replace arbitrary waitForTimeout() delays with condition-based waitForSelector("h1")

Playwright build optimization

  • Extract web server command to helper function for clarity
  • Conditionally skip build in CI where it runs separately in workflow
  • Reduce timeout from 180s to 120s (build no longer included)
const getWebServerCommand = () =>
  process.env.CI ? "npm run preview" : "npm run build && npm run preview";

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Improve zkML circuit tooling and test reliability Address code review feedback from PR #28 Nov 7, 2025
Copilot AI requested a review from Steake November 7, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants