forked from M-Labs/artiq
1
0
Fork 0

Merge branch 'master' into nac3

This commit is contained in:
Sebastien Bourdeauducq 2023-04-30 17:18:05 +08:00
commit 42e42df43f
6 changed files with 11 additions and 7 deletions

3
.gitignore vendored
View File

@ -28,6 +28,7 @@ __pycache__/
/repository/
/results
/last_rid.pyon
/dataset_db.pyon
/dataset_db.mdb
/dataset_db.mdb-lock
/device_db*.py
/test*

View File

@ -1,4 +1,4 @@
import os
def get_version():
return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta")
return os.getenv("VERSIONEER_OVERRIDE", default="8.0+unknown.beta")

View File

@ -5,6 +5,7 @@ import os
import sys
import unittest
import logging
from tempfile import TemporaryDirectory
from nac3artiq import CompileError
@ -20,9 +21,10 @@ logger = logging.getLogger(__name__)
@unittest.skipUnless(artiq_root, "no ARTIQ_ROOT")
class ExperimentCase(unittest.TestCase):
def setUp(self):
self.tempdir = TemporaryDirectory(prefix="artiq_hw_test")
self.device_db = DeviceDB(os.path.join(artiq_root, "device_db.py"))
self.dataset_db = DatasetDB(
os.path.join(artiq_root, "dataset_db.mdb"))
os.path.join(self.tempdir.name, "dataset_db.mdb"))
self.device_mgr = DeviceManager(
self.device_db, virtual_devices={"scheduler": DummyScheduler()})
self.dataset_mgr = DatasetManager(self.dataset_db)
@ -30,6 +32,7 @@ class ExperimentCase(unittest.TestCase):
def tearDown(self):
self.device_mgr.close_devices()
self.dataset_db.close_db()
self.tempdir.cleanup()
def create(self, cls, *args, **kwargs):
try:

View File

@ -29,8 +29,8 @@ def get_env():
class TestClient(unittest.TestCase):
def setUp(self):
self.tmp_dir = TemporaryDirectory(prefix="test")
self.tmp_empty_dir = TemporaryDirectory(prefix="empty_repo")
self.tmp_dir = TemporaryDirectory(prefix="artiq_client_test")
self.tmp_empty_dir = TemporaryDirectory(prefix="artiq_empty_repo")
self.exp_name = "experiment.py"
self.exp_path = os.path.join(self.tmp_dir.name, self.exp_name)
self.device_db_path = os.path.join(self.tmp_dir.name, "device_db.py")

View File

@ -20,7 +20,7 @@
artiqVersionMajor = 9;
artiqVersionMinor = self.sourceInfo.revCount or 0;
artiqVersionId = self.sourceInfo.shortRev or "unknown";
artiqVersion = (builtins.toString artiqVersionMajor) + "." + (builtins.toString artiqVersionMinor) + "." + artiqVersionId + ".beta";
artiqVersion = (builtins.toString artiqVersionMajor) + "." + (builtins.toString artiqVersionMinor) + "+" + artiqVersionId + ".beta";
artiqRev = self.sourceInfo.rev or "unknown";
rustManifest = pkgs.fetchurl {

View File

@ -11,7 +11,7 @@ def get_rev():
"""
def get_version():
return os.getenv("VERSIONEER_OVERRIDE", default="9.0.beta")
return os.getenv("VERSIONEER_OVERRIDE", default="9.0+unknown.beta")
def get_rev():
return os.getenv("VERSIONEER_REV", default="unknown")