Skip to content

Commit

Permalink
s/MARK_WORKSPACE/MARK_SCAN_WORKSPACE (#4060)
Browse files Browse the repository at this point in the history
* s/MARK_WORKSPACE/MARK_SCAN_WORKSPACE

* update integration test mark-workspace
  • Loading branch information
kshen0 authored Oct 10, 2023
1 parent 3fdc483 commit 021f5ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getPaperHandlerDriver } from '@votingworks/custom-paper-handler';
import { join } from 'path';
import { LogSource, Logger } from '@votingworks/logging';
import { createWorkspace } from '../../util/workspace';
import { MARK_WORKSPACE } from '../../globals';
import { MARK_SCAN_WORKSPACE } from '../../globals';
import { DEV_PAPER_HANDLER_STATUS_POLLING_INTERVAL_MS } from '../constants';
import {
PaperHandlerStateMachine,
Expand Down Expand Up @@ -67,7 +67,7 @@ async function logStatus(

export async function main(): Promise<number> {
printUsage();
const workspacePath = MARK_WORKSPACE;
const workspacePath = MARK_SCAN_WORKSPACE;
assert(workspacePath !== undefined, 'expected workspace path');
const workspace = createWorkspace(workspacePath);

Expand Down
4 changes: 2 additions & 2 deletions apps/mark-scan/backend/src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const NODE_ENV = unsafeParse(
/**
* Where should the database and audio files go?
*/
export const MARK_WORKSPACE =
process.env.MARK_WORKSPACE ??
export const MARK_SCAN_WORKSPACE =
process.env.MARK_SCAN_WORKSPACE ??
(NODE_ENV === 'development'
? join(__dirname, '../dev-workspace')
: undefined);
8 changes: 4 additions & 4 deletions apps/mark-scan/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as dotenv from 'dotenv';
import * as dotenvExpand from 'dotenv-expand';
import { isIntegrationTest } from '@votingworks/utils';
import * as server from './server';
import { MARK_WORKSPACE, NODE_ENV, PORT } from './globals';
import { MARK_SCAN_WORKSPACE, NODE_ENV, PORT } from './globals';
import { createWorkspace, Workspace } from './util/workspace';

export type { Api } from './app';
Expand Down Expand Up @@ -41,15 +41,15 @@ for (const dotenvFile of dotenvFiles) {
const logger = new Logger(LogSource.VxMarkScanBackend);

async function resolveWorkspace(): Promise<Workspace> {
const workspacePath = MARK_WORKSPACE;
const workspacePath = MARK_SCAN_WORKSPACE;
if (!workspacePath) {
await logger.log(LogEventId.ScanServiceConfigurationMessage, 'system', {
message:
'workspace path could not be determined; pass a workspace or run with MARK_WORKSPACE',
'workspace path could not be determined; pass a workspace or run with MARK_SCAN_WORKSPACE',
disposition: 'failure',
});
throw new Error(
'workspace path could not be determined; pass a workspace or run with MARK_WORKSPACE'
'workspace path could not be determined; pass a workspace or run with MARK_SCAN_WORKSPACE'
);
}
return createWorkspace(workspacePath);
Expand Down
6 changes: 3 additions & 3 deletions apps/mark-scan/integration-testing/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP := ..
export PIPENV_VENV_IN_PROJECT=1
export MARK_WORKSPACE=/tmp/mark-integration-testing
export MARK_SCAN_WORKSPACE=/tmp/mark-scan-integration-testing

build-frontend:
make -C $(APP)/frontend install; \
Expand All @@ -13,8 +13,8 @@ build-backend:
build: build-frontend build-backend

run:
rm -rf $(MARK_WORKSPACE)
mkdir $(MARK_WORKSPACE)
rm -rf $(MARK_SCAN_WORKSPACE)
mkdir $(MARK_SCAN_WORKSPACE)
NODE_ENV=production IS_INTEGRATION_TEST=true VX_MACHINE_TYPE=mark \
./node_modules/.bin/concurrently -n frontend,backend --kill-others \
"make -C $(APP)/frontend run" \
Expand Down

0 comments on commit 021f5ea

Please sign in to comment.