Skip to content

Commit

Permalink
fix(ci): allow longer test timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
DecentM committed Jan 12, 2024
1 parent 6872ca9 commit 70c13ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions packages/bot/clinic/benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { AfenPreset, Board } from '@decentm/allegiance-chess-core'
import { randomBytes } from 'node:crypto'

import { Bot } from '../src/engine'

const b = new Board()

b.importAFEN(AfenPreset.VanillaDefault)

const _seed = randomBytes(8).toString('hex')

console.log('Running performance benchmark...')
const start = performance.now()

Expand All @@ -22,7 +19,7 @@ const bot = new Bot()
while (MOVES > 0) {
const moveStart = performance.now()

const { index, score, seed } = bot.findBestMove(3, _seed)
const { index, score } = bot.findBestMove(3)

Check warning on line 22 in packages/bot/clinic/benchmark.ts

View workflow job for this annotation

GitHub Actions / lint

'score' is assigned a value but never used

if (index === -1) {
console.log('No moves!')
Expand Down
6 changes: 3 additions & 3 deletions packages/bot/clinic/self-play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const b = new Board()

b.importAFEN(AfenPreset.VanillaDefault)

const _seed = randomBytes(8).toString('hex')
const seed = randomBytes(8).toString('hex')

const bot = new Bot()
const bot = new Bot(seed)

// eslint-disable-next-line no-constant-condition
while (true) {
Expand All @@ -25,7 +25,7 @@ while (true) {
}
}

const { index, score, seed } = bot.findBestMove(3, _seed)
const { index, score } = bot.findBestMove(3)

if (index === -1) {
console.log('No moves!')
Expand Down
2 changes: 1 addition & 1 deletion packages/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@decentm/allegiance-chess-bot",
"version": "0.0.1",
"scripts": {
"t": "c8 ava",
"t": "c8 ava --timeout 5m",
"ingest-openings": "ts-node --transpile-only -r tsconfig-paths/register tools/opening-ingestion.ts",
"dev": "ts-node-dev --transpile-only --clear -r tsconfig-paths/register",
"clinic": "TS_NODE_PROJECT=tsconfig.spec.json clinic",
Expand Down

0 comments on commit 70c13ec

Please sign in to comment.