mirror of
https://gitlab.cern.ch/wotsubo/psboard-qaqc-postprocess.git
synced 2025-07-01 17:19:29 +09:00
new: implement till parsing file (no output)
This commit is contained in:
parent
474f2397c6
commit
a14eb4ea48
7 changed files with 604 additions and 24 deletions
41
tests/cli.rs
Normal file
41
tests/cli.rs
Normal file
|
@ -0,0 +1,41 @@
|
|||
mod integrated_test {
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Result;
|
||||
use assert_cmd::{assert::OutputAssertExt, Command};
|
||||
use predicates::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn full_log() -> Result<()> {
|
||||
let test_out_dir = assert_fs::TempDir::new()?;
|
||||
let test_out = PathBuf::new().join(&test_out_dir).join("out.csv");
|
||||
|
||||
let mut cmd = Command::cargo_bin("psb-qaqc-parse")?;
|
||||
cmd.current_dir("tests")
|
||||
.arg("./example_logs/valid/20240620_083537.log")
|
||||
.arg(test_out.as_path())
|
||||
.assert()
|
||||
.success();
|
||||
// .failure()
|
||||
// .stderr(predicate::str::contains("not yet implemented"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn partial_log() -> Result<()> {
|
||||
let test_out_dir = assert_fs::TempDir::new()?;
|
||||
let test_out = PathBuf::new().join(&test_out_dir).join("out.csv");
|
||||
|
||||
let mut cmd = Command::cargo_bin("psb-qaqc-parse")?;
|
||||
cmd.current_dir("tests")
|
||||
.arg("./example_logs/valid/20240620_093537.log")
|
||||
.arg(test_out.as_path())
|
||||
.assert()
|
||||
.success();
|
||||
// .failure()
|
||||
// .stderr(predicate::str::contains("not yet implemented"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
48
tests/example_logs/valid/20240620_083537.log
Normal file
48
tests/example_logs/valid/20240620_083537.log
Normal file
|
@ -0,0 +1,48 @@
|
|||
Shift script: 0.0.0
|
||||
----------------------
|
||||
Date: 2024-06-20T08:42:01+0000
|
||||
Shifters: Alice
|
||||
----------------------
|
||||
PBS Assignment:
|
||||
Position / assigned-ID : A-0-0 / PB0004
|
||||
Position / assigned-ID : A-1-0 / PB0004
|
||||
Position / assigned-ID : A-0-1 / PB0004
|
||||
Position / assigned-ID : A-1-1 / PB0004
|
||||
Position / assigned-ID : A-0-2 / PB0004
|
||||
Position / assigned-ID : A-1-2 / PB0004
|
||||
Position / assigned-ID : A-0-3 / PB0004
|
||||
Position / assigned-ID : A-1-3 / PB0004
|
||||
Position / assigned-ID : A-0-4 / PB0004
|
||||
Position / assigned-ID : A-1-4 / PB0004
|
||||
Position / assigned-ID : A-0-5 / PB0004
|
||||
Position / assigned-ID : A-1-5 / PB0004
|
||||
Position / assigned-ID : A-0-6 / PB0004
|
||||
Position / assigned-ID : A-1-6 / PB0004
|
||||
Position / assigned-ID : A-0-7 / PB0004
|
||||
Position / assigned-ID : A-1-7 / PB0004
|
||||
Position / assigned-ID : A-0-8 / PB0004
|
||||
Position / assigned-ID : A-1-8 / PB0004
|
||||
======================
|
||||
QAQC status| QSPIf | QSPIp | Recov | Clock | RegAc | ASDTP | DONE |
|
||||
-----------------------------------------------------------------------
|
||||
Station0
|
||||
JATHub_ 1| 0| 1| 1| 0| 1| 1| 1|
|
||||
JATHub_ 2| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 3| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 4| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 5| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 6| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 7| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 8| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 9| 0| 0| 1| 0| 1| 1| 1|
|
||||
Station1
|
||||
JATHub_11| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_12| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_13| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_14| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_15| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_16| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_17| 0| 0| 1| 1| 1| 2| 1|
|
||||
JATHub_18| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_19| 0| 0| 0| 0| 0| 0| 0|
|
||||
======================
|
40
tests/example_logs/valid/20240620_093537.log
Normal file
40
tests/example_logs/valid/20240620_093537.log
Normal file
|
@ -0,0 +1,40 @@
|
|||
Shift script: 0.0.0
|
||||
----------------------
|
||||
Date: 2024-06-20T09:42:01+0000
|
||||
Shifters: Alice
|
||||
----------------------
|
||||
PBS Assignment:
|
||||
Position / assigned-ID : A-0-0 / PB0004
|
||||
Position / assigned-ID : A-1-0 / PB0004
|
||||
Position / assigned-ID : A-0-1 / PB0004
|
||||
Position / assigned-ID : A-1-1 / PB0004
|
||||
Position / assigned-ID : A-0-4 / PB0004
|
||||
Position / assigned-ID : A-1-4 / PB0004
|
||||
Position / assigned-ID : A-0-5 / PB0004
|
||||
Position / assigned-ID : A-1-5 / PB0004
|
||||
Position / assigned-ID : A-0-6 / PB0004
|
||||
Position / assigned-ID : A-1-6 / PB0004
|
||||
Position / assigned-ID : A-0-7 / PB0004
|
||||
Position / assigned-ID : A-1-7 / PB0004
|
||||
Position / assigned-ID : A-0-8 / PB0004
|
||||
Position / assigned-ID : A-1-8 / PB0004
|
||||
======================
|
||||
QAQC status| QSPIf | QSPIp | Recov | Clock | RegAc | ASDTP | DONE |
|
||||
-----------------------------------------------------------------------
|
||||
Station0
|
||||
JATHub_ 1| 0| 1| 1| 0| 1| 1| 1|
|
||||
JATHub_ 2| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 5| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 6| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 7| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 8| 0| 0| 1| 0| 1| 1| 1|
|
||||
JATHub_ 9| 0| 0| 1| 0| 1| 1| 1|
|
||||
Station1
|
||||
JATHub_11| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_12| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_15| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_16| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_17| 0| 0| 1| 1| 1| 2| 1|
|
||||
JATHub_18| 0| 0| 1| 1| 1| 1| 1|
|
||||
JATHub_19| 0| 0| 0| 0| 0| 0| 0|
|
||||
======================
|
Loading…
Add table
Add a link
Reference in a new issue