mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-07 10:48:41 +01:00
All checks were successful
Build on RHEL9 / build (push) Successful in 3m50s
Build on RHEL8 / build (push) Successful in 4m46s
Run Simulator Tests on local RHEL9 / build (push) Successful in 14m37s
Build on local RHEL9 / build (push) Successful in 1m26s
Run Simulator Tests on local RHEL8 / build (push) Successful in 16m57s
Build on local RHEL8 / build (push) Successful in 3m33s
* added simulator tests in github workflows * indentation error * typo * debug * Logging for debugging * added more debug lines * more debugging * debug * debug * debug * dont throw if process does not exist * debug * added absolute path to sls_detector commands * some refactoring in test scripts * added absolute path to all slsdet command * typo * ../tests/scripts/test_frame_synchronizer.py * raise exception upon failure for github workflows * removed hidden tags * some refactoring in test scripts * some refactoring * fixed CMakeLists * fixed unsuccesful merge * updated python tests using simulators * debug import error * debug module import * python -m runs module pytest as script - everything in path available * removed integartion tests * enable file write not to log files * run tests without log files * increased sleep time for udp packets * added logg level variable to cmake * added testing policies to documenattion * disabled check for num_frames for jungfrau & xilinx * set log level as cmake cached variable * disable tests for jungfrau and xilinx_ctb * check frames for HDF5 * updated Documentation of Testing * changed withdetectorsimulators to detectorintegration * replaced [.cmdcall] with [.detectorintegration] * check_file_size only disabled for jungfrau - disable for all roi tests * changed time to wait after receive to 5 ms * take into account half modules of eiger * num udp interfaces needs to be consistent across modules * suppressed warning enclosing if * config added 2 udp ports per default for moench and jungfrau * write detector output to console * allow jungfrau to tests num frames, remove unused variable (numinterfaces), add comment for future to handle traceback to know which calling function threw the files unmatched, added documentation for tests (examples for .detectoritnegration and how to disable marked tests, removed addditional argumetns to disable for test_simulator as one can just use ~, removed the check that checks for jungfrau checking number of frames at master attributes and at rx test, removed unused advanced_test_settings in test_simulator script, the num_mods check for multiple modules is removed and default num modules set to 1 for test_simulator (to be increased later), back to raising exception for killprocess * removed integration tests from cmakelists.txt and cmk.sh, modified the tests workflow command to reflect the disable argument and removed xilinx_ctb from test (fix fromdeveloper merge to be done) * filtering by actual name for disable certain tests on github workflow * minor refactor * wip * wip * changes to run on local rh9 runner instead of github workfloa * modified yml to remove some leftover from github workflow * test * fix build_dir in scripts (github workflow) and pytest dir in gitea workflow * making the local machine use python3.13 binary * pythonpath added * changes for build_Dir back * allowing ctb api tests * allowed ctb api tests and set up slsdetname envt variable for shared memory being reserved just for these tests * added rh8 workflow for local runner on gitea * remnants from rh9 local runner * remnants from rh9 local runner * conda env for all shell for local runner * allowing hdf5 to build on local runner * run all tests for both the runners * refactored fixtures a bit and merged some tests that use one session for entire server * test fail * test fix * adding github workflow to test without data file checks and without logs * documentation changes * unnecessary import in conftest * allowing the session_simulator to test for multiple modules and interfaces etc * allow test_simulator script to run for 2 modules for all modules except ctb and xilinx ctb * run upon push * removing the disable file check on github workflow * minor adjustment * testing without synch * reverting to previous * with log file * without the space * summary from file and more error extracts from file to terminal * minor * trying nlf for more details * updated with no log file to print everything to screen also for det and rxr * trying a no throw * stoi was more about indent in yaml * tries * wip * debug * number of frames inconsistent fix=>just take first one, only test xilinx * jungfrau tests without frames caught check * extend the disable file check to everywhere that creates files * specify path for test_simulator * withoutprinting == * wip * back with printing===, but not parsing file for errors anymore * lang? * wip * safe log? * wip2 * wip * dont split error as its streaming live, just raise * with log files * lang? * last resort * wip * test no det with general tests * show tests live * also include hidden integration tests * without extra summary? * revert * last resort again * tsquash on int64_t? * tsquash on int64_t? mroe print * writing to /tmp? * all tests * might be the fix? * write to file * fixed a few quiet mode no log file tests * work on any branch for github tests, work on also release candidates for gitea tests * added frame synchronizer tests to github workflow * moved tests to run_tests.yaml from cmake.yaml * documentation * disabled general tests --------- Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
104 lines
4.1 KiB
C++
104 lines
4.1 KiB
C++
// SPDX-License-Identifier: LGPL-3.0-or-other
|
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
#pragma once
|
|
|
|
#include "Caller.h"
|
|
#include "sls/Detector.h"
|
|
#include "sls/ToString.h"
|
|
#include "sls/logger.h"
|
|
#include "sls/sls_detector_defs.h"
|
|
|
|
#include <chrono>
|
|
#include <filesystem>
|
|
#include <optional>
|
|
#include <thread>
|
|
|
|
namespace sls {
|
|
struct testFileInfo {
|
|
std::string file_path{"/tmp"};
|
|
std::string file_prefix{"sls_test"};
|
|
int64_t file_acq_index{0};
|
|
bool file_write{true};
|
|
bool file_overwrite{true};
|
|
slsDetectorDefs::fileFormat file_format{slsDetectorDefs::BINARY};
|
|
std::string getMasterFileNamePrefix() const {
|
|
return file_path + "/" + file_prefix + "_master_" +
|
|
std::to_string(file_acq_index);
|
|
}
|
|
std::string getVirtualFileName() const {
|
|
return file_path + "/" + file_prefix + "_virtual_" +
|
|
std::to_string(file_acq_index) + ".h5";
|
|
}
|
|
inline void print() const {
|
|
LOG(logINFO) << "File Info: "
|
|
<< "\n\tFile Path: " << file_path
|
|
<< "\n\tFile Prefix: " << file_prefix
|
|
<< "\n\tFile Acquisition Index: " << file_acq_index
|
|
<< "\n\tFile Write: " << file_write
|
|
<< "\n\tFile Overwrite: " << file_overwrite
|
|
<< "\n\tFile Format: " << ToString(file_format)
|
|
<< "\n\tMaster Filename: " << getMasterFileNamePrefix()
|
|
<< "\n\tVirtual Filename: " << getVirtualFileName();
|
|
}
|
|
};
|
|
|
|
struct testCtbAcquireInfo {
|
|
defs::readoutMode readout_mode{defs::ANALOG_AND_DIGITAL};
|
|
bool ten_giga{false};
|
|
int num_adc_samples{5000};
|
|
int num_dbit_samples{6000};
|
|
int num_trans_samples{288};
|
|
uint32_t adc_enable_1g{0xFFFFFF00};
|
|
uint32_t adc_enable_10g{0xFF00FFFF};
|
|
int dbit_offset{0};
|
|
std::vector<int> dbit_list{0, 12, 2, 43};
|
|
bool dbit_reorder{false};
|
|
uint32_t transceiver_mask{0x3};
|
|
|
|
inline void print() const {
|
|
LOG(logINFO) << "CTB Acquire Info: "
|
|
<< "\n\tReadout Mode: " << ToString(readout_mode)
|
|
<< "\n\tTen Giga: " << ten_giga
|
|
<< "\n\tADC Enable 1G: " << std::hex << adc_enable_1g
|
|
<< std::dec << "\n\tADC Enable 10G: " << std::hex
|
|
<< adc_enable_10g << std::dec
|
|
<< "\n\tNumber of Analog Samples: " << num_adc_samples
|
|
<< "\n\tNumber of Digital Samples: " << num_dbit_samples
|
|
<< "\n\tNumber of Transceiver Samples: "
|
|
<< num_trans_samples << "\n\tDBIT Offset: " << dbit_offset
|
|
<< "\n\tDBIT Reorder: " << dbit_reorder
|
|
<< "\n\tDBIT List: " << ToString(dbit_list)
|
|
<< "\n\tTransceiver Mask: " << std::hex << transceiver_mask
|
|
<< std::dec << std::endl;
|
|
}
|
|
};
|
|
|
|
void test_valid_port_caller(const std::string &command,
|
|
const std::vector<std::string> &arguments,
|
|
int detector_id, int action);
|
|
|
|
void test_dac_caller(slsDetectorDefs::dacIndex index,
|
|
const std::string &dacname, int dacvalue);
|
|
void test_onchip_dac_caller(slsDetectorDefs::dacIndex index,
|
|
const std::string &dacname, int dacvalue);
|
|
|
|
testFileInfo get_file_state(const Detector &det);
|
|
void set_file_state(Detector &det, const testFileInfo &file_info);
|
|
void test_acquire_binary_file_size(const testFileInfo &file_info,
|
|
uint64_t num_frames_to_acquire,
|
|
uint64_t expected_image_size);
|
|
|
|
void test_acquire_with_receiver(Caller &caller, const Detector &det);
|
|
|
|
void create_files_for_acquire(
|
|
Detector &det, Caller &caller, int64_t num_frames = 1,
|
|
const std::optional<testCtbAcquireInfo> &test_info = std::nullopt);
|
|
|
|
testCtbAcquireInfo get_ctb_config_state(const Detector &det);
|
|
void set_ctb_config_state(Detector &det,
|
|
const testCtbAcquireInfo &ctb_config_info);
|
|
std::pair<uint64_t, int>
|
|
calculate_ctb_image_size(const testCtbAcquireInfo &test_info, bool isXilinxCtb);
|
|
|
|
} // namespace sls
|