Skip to content

Commit

Permalink
Tests: Have ability to specify the container name to test against, wh…
Browse files Browse the repository at this point in the history
…ich is helpful when deving locally.
  • Loading branch information
adamdoupe committed Jan 12, 2024
1 parent fce53bf commit 22f4f3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_running.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import json
import os
import random
import re
import shutil
import string
import subprocess
import shutil

import requests
import pytest


PROTO="http"
HOST="localhost.pwn.college"

CONTAINER_NAME = os.environ.get("CONTAINER_NAME", "dojo-test")

def dojo_run(*args, **kwargs):
kwargs.update(stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True)
container_name = "dojo-test"
return subprocess.run([shutil.which("docker"), "exec", "-i", container_name, "dojo", *args], **kwargs)
return subprocess.run([shutil.which("docker"), "exec", "-i", CONTAINER_NAME, "dojo", *args], **kwargs)


def workspace_run(cmd, *, user):
Expand Down

0 comments on commit 22f4f3f

Please sign in to comment.