Skip to content

Commit

Permalink
chore: doc & prepare-tests script
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Jan 23, 2025
1 parent 8e7f57d commit 7a61f5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/prepare-for-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import path from 'path'
import cp from 'child_process'
import fetch from 'node-fetch'

console.log(`Preparing for tests...`)

const targetVersions = JSON.parse(await fs.readFile('./tests/ffmpegReleases.json'))

const toPosix = (str) => str.split(path.sep).join(path.posix.sep)
Expand All @@ -33,12 +35,14 @@ async function pathExists(path) {

const platformInfo = `${process.platform}-${process.arch}`
const platformVersions = targetVersions[platformInfo]
let didDoAnything = false

if (platformVersions) {
for (const version of platformVersions) {
const versionPath = path.join(ffmpegRootDir, version.id)
const dirStat = await pathExists(versionPath)
if (!dirStat) {
didDoAnything = true
console.log(`Fetching ${version.url}`)
// Download it

Expand Down Expand Up @@ -81,3 +85,9 @@ if (platformVersions) {
} else {
throw new Error(`No FFMpeg binaries have been defined for "${platformInfo}" yet`)
}

if (!didDoAnything) {
console.log(`Nothing to prepare!`)
} else {
console.log(`Preparations done!`)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export async function evaluateExpectationStateFulfilled({
assertState(trackedExp, ExpectedPackageStatusAPI.WorkStatusState.FULFILLED)
// TODO: Some monitor that is able to invalidate if it isn't fulfilled anymore?

// We don't want to check too often if it's still fulfilled:
if (timeSinceLastEvaluation > tracker.getFulfilledWaitTime()) {
await manager.workerAgents.assignWorkerToSession(trackedExp)
if (trackedExp.session.assignedWorker) {
Expand Down

0 comments on commit 7a61f5f

Please sign in to comment.