Skip to content

Commit ee115db

Browse files
committed
add ps1 file to process with the column name
update expected_memory.tsv for failing values update the verify_runtime.sh to check with usr/bin/time
1 parent fea468f commit ee115db

File tree

6 files changed

+77
-51
lines changed

6 files changed

+77
-51
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
- gcc-version: 9
2525
cmake-version: 3.14.7
2626
upload: true
27-
runtime-arg: 4
27+
runtime-arg: Linux-gcc-9
2828
memory-arg: Linux-gcc-9
2929
# Latest supported gcc and cmake versions
3030
- gcc-version: 12
3131
cmake-version: latest
3232
upload: false
33-
runtime-arg: 5
33+
runtime-arg: Linux-gcc-12
3434
memory-arg: Linux-gcc-12
3535

3636
steps:
@@ -132,7 +132,7 @@ jobs:
132132
- name: Run verify_runtimes.sh
133133
run: |
134134
chmod +x test_scripts/verify_runtime.sh
135-
./test_scripts/verify_runtime.sh 6
135+
./test_scripts/verify_runtime.sh Linux-aarch64
136136
137137
- name: Run verify_memory.sh
138138
run: |
@@ -222,7 +222,7 @@ jobs:
222222
- name: Run verify_runtimes.sh
223223
run: |
224224
chmod +x test_scripts/verify_runtime.sh
225-
./test_scripts/verify_runtime.sh 7
225+
./test_scripts/verify_runtime.sh mac-os-x86-64
226226
227227
- name: Run verify_memory.sh
228228
run: |
@@ -275,7 +275,7 @@ jobs:
275275
- name: Run verify_runtimes.sh
276276
run: |
277277
chmod +x test_scripts/verify_runtime.sh
278-
./test_scripts/verify_runtime.sh 8
278+
./test_scripts/verify_runtime.sh mac-os-arm64
279279
280280
- name: Run verify_memory.sh
281281
run: |

test_scripts/test_data/expected_memory.tsv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turt
1414
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.nex -g test_scripts/test_data/turtle.constr.tree2 -B 1000 -alrt 1000 --prefix test_scripts/test_data/turtle.nex.constr2 -T 1 -seed 73073 3 18.82 18.70 17.55 13.29 14.00 19.74
1515
build/iqtree3 -s test_scripts/test_data/turtle.fa -m MIX+MF --prefix test_scripts/test_data/turtle.mixfinder -T 1 -seed 73073 3 14.55 15.50 11.68 9.21 9.28 20.19
1616
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -B 1000 -T 1 -seed 73073 3 25.57 25.66 24.47 21.26 15.77 22.72
17-
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -B 1000 -T 1 -seed 73073 3 76.22 67.05 26.73 23.80 16.39 24.45
18-
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -B 1000 -T 1 -m MFP+MERGE -rcluster 10 --prefix test_scripts/test_data/turtle_aa.merge -seed 73073 3 41.34 31.46 26.11 22.30 16.56 25.05
17+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -B 1000 -T 1 -seed 73073 3 76.22 67.05 26.73 23.80 16.39 28.9
18+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -B 1000 -T 1 -m MFP+MERGE -rcluster 10 --prefix test_scripts/test_data/turtle_aa.merge -seed 73073 3 41.34 31.46 26.11 22.30 16.56 28.35
1919
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.merge.best_scheme.nex -z test_scripts/test_data/turtle_aa.trees -zb 10000 -au -n 0 --prefix test_scripts/test_data/turtle_aa.test -seed 73073 -T 1 3 33.53 33.46 32.43 31.32 30.30 33.82
2020
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex.best_scheme.nex -z test_scripts/test_data/turtle_aa.trees -n 0 -wpl --prefix test_scripts/test_data/turtle_aa.wpl -seed 73073 -T 1 3 18.26 18.32 16.95 14.17 12.81 14.99
2121
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -S test_scripts/test_data/turtle_aa.nex --prefix test_scripts/test_data/turtle_aa.loci -T 1 -seed 73073 3 16.49 16.11 13.53 11.07 9.69 14.96
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Command diff-threshold Linux-gcc-9 Linux-gcc-12 Linux-aarch64 mac-os-x86-64 mac-os-arm64 windows-x86
2+
build/iqtree3 -s test_scripts/test_data/turtle.fa -B 1000 -T 1 -seed 73073 2 3.24 3.32 5.03 3.62 2.96 4.55
3+
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.nex -B 1000 -T 1 -seed 73073 2 3.46 3.59 4.32 3.63 2.74 4.06
4+
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.nex -B 1000 -T 1 -m MFP+MERGE -rcluster 10 --prefix test_scripts/test_data/turtle.merge -seed 73073 2 3.35 3.49 5.01 4.14 3.00 3.86
5+
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.merge.best_scheme.nex -z test_scripts/test_data/turtle.trees -zb 10000 -au -n 0 --prefix test_scripts/test_data/turtle.test -seed 73073 -T 1 2 1.34 1.31 0.74 0.85 0.78 3.26
6+
build/iqtree3 -s test_scripts/test_data/turtle.fa -m GTR+F+I+R3+T -te test_scripts/test_data/turtle.trees -T 1 --prefix test_scripts/test_data/turtle.mix -seed 73073 2 2.43 2.36 3.76 2.29 2.52 2.85
7+
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.nex.best_scheme.nex -z test_scripts/test_data/turtle.trees -n 0 -wpl --prefix test_scripts/test_data/turtle.wpl -seed 73073 -T 1 2 0.05 0.05 0.05 0.13 0.04 0.62
8+
build/iqtree3 -s test_scripts/test_data/turtle.fa -S test_scripts/test_data/turtle.nex --prefix test_scripts/test_data/turtle.loci -T 1 -seed 73073 2 3.64 3.82 4.88 3.90 2.94 3.86
9+
build/iqtree3 -t test_scripts/test_data/turtle.nex.treefile --gcf test_scripts/test_data/turtle.loci.treefile -s test_scripts/test_data/turtle.fa --scf 100 -seed 73073 -T 1 1 0.01 0.01 0.01 0.02 0.01 0.4
10+
build/iqtree3 -t test_scripts/test_data/turtle.fa.treefile --gcf test_scripts/test_data/turtle.loci.treefile -s test_scripts/test_data/turtle.fa --scf 100 -seed 73073 -T 1 1 0.01 0.01 0.01 0.02 0.01 0.41
11+
build/iqtree3 -s test_scripts/test_data/turtle.fa -m MIX{GTR+FO,GTR+FO} --link-exchange-rates --prefix test_scripts/test_data/turtle.mix.link -seed 73073 -T 1 2 0.79 0.82 1.23 0.69 0.64 0.4
12+
build/iqtree3 -s test_scripts/test_data/turtle.fa -m MIX{GTR{1,1,1,1,1,1}+FO,GTR{1,1,1,1,1,1}+FO} --link-exchange-rates --prefix test_scripts/test_data/turtle.mix.jc.link -seed 73073 -T 1 2 0.70 0.74 1.09 0.82 0.71 0.41
13+
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.nex -g test_scripts/test_data/turtle.constr.tree --prefix test_scripts/test_data/turtle.nex.constr -T 1 -seed 73073 2 3.05 3.17 3.83 3.62 2.22 3.47
14+
build/iqtree3 -s test_scripts/test_data/turtle.fa -p test_scripts/test_data/turtle.nex -g test_scripts/test_data/turtle.constr.tree2 -B 1000 -alrt 1000 --prefix test_scripts/test_data/turtle.nex.constr2 -T 1 -seed 73073 2 3.50 3.58 4.25 3.95 2.49 4.27
15+
build/iqtree3 -s test_scripts/test_data/turtle.fa -m MIX+MF --prefix test_scripts/test_data/turtle.mixfinder -T 1 -seed 73073 3 9.15 8.47 14.31 9.81 8.20 0.42
16+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -B 1000 -T 1 -seed 73073 12 62.06 65.05 100.61 35.56 40.99 35.76
17+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -B 1000 -T 1 -seed 73073 12 71.33 72.66 116.11 44.03 46.82 41.86
18+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -B 1000 -T 1 -m MFP+MERGE -rcluster 10 --prefix test_scripts/test_data/turtle_aa.merge -seed 73073 12 65.65 67.02 106.90 39.94 40.45 37.61
19+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.merge.best_scheme.nex -z test_scripts/test_data/turtle_aa.trees -zb 10000 -au -n 0 --prefix test_scripts/test_data/turtle_aa.test -seed 73073 -T 1 2 2.66 2.61 3.17 1.43 1.61 3.26
20+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex.best_scheme.nex -z test_scripts/test_data/turtle_aa.trees -n 0 -wpl --prefix test_scripts/test_data/turtle_aa.wpl -seed 73073 -T 1 2 1.80 1.83 2.92 1.08 1.27 1.62
21+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -S test_scripts/test_data/turtle_aa.nex --prefix test_scripts/test_data/turtle_aa.loci -T 1 -seed 73073 12 55.46 56.38 89.44 34.67 35.94 32.52
22+
build/iqtree3 -t test_scripts/test_data/turtle_aa.nex.treefile --gcf test_scripts/test_data/turtle_aa.loci.treefile -s test_scripts/test_data/turtle_aa.fasta --scf 100 -seed 73073 -T 1 1 0.01 0.01 0.01 0.02 0.02 0.4
23+
build/iqtree3 -t test_scripts/test_data/turtle_aa.fasta.treefile --gcf test_scripts/test_data/turtle_aa.loci.treefile -s test_scripts/test_data/turtle_aa.fasta --scf 100 -seed 73073 -T 1 1 0.01 0.01 0.01 0.02 0.01 0.41
24+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -m MIX{LG+F,WAG+F} --prefix test_scripts/test_data/turtle_aa.mix -seed 73073 -T 1 3 13.04 13.33 21.36 7.23 8.97 0.41
25+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -g test_scripts/test_data/turtle.constr.tree --prefix test_scripts/test_data/turtle_aa.nex.constr -T 1 -seed 73073 12 61.22 61.69 99.07 37.95 39.54 35.39
26+
build/iqtree3 -s test_scripts/test_data/turtle_aa.fasta -p test_scripts/test_data/turtle_aa.nex -g test_scripts/test_data/turtle.constr.tree2 -B 1000 -alrt 1000 --prefix test_scripts/test_data/turtle_aa.nex.constr2 -T 1 -seed 73073 12 82.86 85.39 135.76 49.92 53.91 48.37

test_scripts/verify_memory.ps1

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
param (
2-
[int] $ExpectedColumn = 8
2+
[string] $ExpectedColumnName = "windows-x86"
33
)
44

55
$WD = "test_scripts/test_data"
@@ -9,11 +9,21 @@ $selectedColumnsFile = Join-Path $WD "selected_columns.tsv"
99
$reportedColumnFile = "$env:TEMP\reported_column.tsv"
1010
$finalFile = Join-Path $WD "combined_with_reported.tsv"
1111

12-
# Read expected: Command, Threshold, ExpectedColumn
12+
# Get the header and find the index of the expected column name
13+
$header = Get-Content $expectedFile -TotalCount 1
14+
$columns = $header -split "`t"
15+
$columnIndex = $columns.IndexOf($ExpectedColumnName)
16+
17+
if ($columnIndex -lt 0) {
18+
Write-Error "Column '$ExpectedColumnName' not found in $expectedFile"
19+
exit 1
20+
}
21+
22+
# Adjust to 0-based indexing for arrays
1323
$expectedLines = Get-Content $expectedFile | Select-Object -Skip 1
1424
$selectedColumns = foreach ($line in $expectedLines) {
1525
$parts = $line -split "`t"
16-
"$($parts[0])`t$($parts[1])`t$($parts[$ExpectedColumn - 1])"
26+
"$($parts[0])`t$($parts[1])`t$($parts[$columnIndex])"
1727
}
1828
$selectedColumns | Set-Content $selectedColumnsFile
1929

@@ -59,7 +69,7 @@ foreach ($line in $finalLines) {
5969
Write-Host ""
6070

6171
if ($failCount -eq 0) {
62-
Write-Host "✅ All runtime/memory checks passed."
72+
Write-Host "✅ All memory checks passed."
6373
exit 0
6474
} else {
6575
Write-Host "$failCount checks failed."

test_scripts/verify_memory.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ while IFS=$'\t' read -r command threshold expected reported; do
4343
done < <(tail -n +2 "$final_file")
4444

4545
if [ "$fail_count" -eq 0 ]; then
46-
echo "✅ All runtime checks passed."
46+
echo "✅ All memory checks passed."
4747
else
4848
echo "$fail_count checks failed."
4949
exit 1

test_scripts/verify_runtime.sh

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,46 @@
22
expected_column="$1"
33

44
WD="test_scripts/test_data"
5-
input_file="${WD}/expected_runtimes.tsv"
6-
selected_colums_file="${WD}/selected_columns.tsv"
7-
cut -f1,2,3,"$expected_column" "$input_file" > "${selected_colums_file}"
5+
input_file="${WD}/expected_runtime.tsv"
6+
reported_file="time_log.tsv"
7+
selected_columns_file="${WD}/selected_columns.tsv"
88

9-
fail_count=0
10-
line_num=0
11-
12-
while IFS=$'\t' read -r iqtree_file field_name threshold expected_value || [ -n "$iqtree_file" ]; do
13-
((line_num++))
9+
# Get the column index (1-based) of the expected column name
10+
col_index=$(head -1 "$input_file" | tr '\t' '\n' | awk -v col="$expected_column" '{if ($0 == col) print NR}')
1411

15-
# Skip header (first line)
16-
if [ "$line_num" -eq 1 ]; then
17-
continue
18-
fi
12+
# Check if column was found
13+
if [[ -z "$col_index" ]]; then
14+
echo "Column '$expected_column' not found in $input_file"
15+
exit 1
16+
fi
1917

20-
iqtree_file="${WD}/${iqtree_file}"
18+
cut -f1,2,"$col_index" "$input_file" > "${selected_columns_file}"
19+
final_file="${WD}/combined_with_reported.tsv"
2120

22-
if [ ! -f "$iqtree_file" ]; then
23-
echo "File not found: $iqtree_file"
24-
continue
25-
fi
21+
# assuming the reported file and expected file have the same order of commands
22+
cut -f2 "$reported_file" > /tmp/reported_column.tsv
23+
paste "$selected_columns_file" /tmp/reported_column.tsv > "$final_file"
2624

27-
# Look for the line containing the field name
28-
report_line=$(grep -F "$field_name" "$iqtree_file")
29-
if [ -z "$report_line" ]; then
30-
echo "Field not found in $iqtree_file: $field_name"
31-
continue
32-
fi
3325

34-
# Extract the first numeric value from the matched line
35-
report_value=$(echo "$report_line" | grep -Eo '[-+]?[0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+)?' | head -n1)
36-
if [ -z "$report_value" ]; then
37-
echo "No numeric value found in line: $report_line"
38-
continue
39-
fi
26+
fail_count=0
4027

41-
# Compute report value less than the highest value
42-
higest_value=$(echo "$expected_value + $threshold" | bc -l)
43-
result=$(echo "$report_value <= $higest_value" | bc -l)
28+
# Skip header
29+
while IFS=$'\t' read -r command threshold expected reported; do
30+
allowed=$(echo "$expected + $threshold" | bc -l)
31+
is_exceed=$(echo "$reported > $allowed" | bc -l)
4432

45-
if [ "$result" -eq 1 ]; then
46-
echo "PASS: $iqtree_file -- Expected: ${expected_value}, Reported: ${report_value}, Threshold: $threshold"
47-
else
48-
echo "FAIL: $iqtree_file ($field_name)"
49-
echo " Expected: ${expected_value}, Reported: ${report_value}, Threshold: $threshold"
33+
if [ "$is_exceed" = "1" ]; then
34+
diff=$(echo "$reported - $expected" | bc -l)
35+
echo "$command exceeded the allowed runtime usage."
36+
echo "Expected: $expected S, Threshold: $threshold S, Reported: $reported S, Difference: $diff S"
5037
((fail_count++))
38+
else
39+
echo "$command passed the runtime check."
40+
diff=$(echo "$reported - $expected" | bc -l)
41+
echo "Expected: $expected S, Threshold: $threshold S, Reported: $reported S, Difference: $diff S"
5142
fi
52-
done < "$selected_colums_file"
43+
done < <(tail -n +2 "$final_file")
5344

54-
echo
5545
if [ "$fail_count" -eq 0 ]; then
5646
echo "✅ All runtime checks passed."
5747
else

0 commit comments

Comments
 (0)