new: create tables & add campaigns, runs, ps_boards, single run results

- currently, test automatically opens sqlitebrowser
- ext package is not well checked
This commit is contained in:
Wataru Otsubo 2024-09-12 20:26:38 +09:00 committed by qwjyh
commit eba8d8f395
10 changed files with 1203 additions and 0 deletions

28
test/runtests.jl Normal file
View file

@ -0,0 +1,28 @@
using Test
using PSBoardDataBase
using CSV, DataFrames
true || include("../src/PSBoardDataBase.jl")
@testset "PSBoardDataBase" begin
dbpath = tempname()
db = PSBoardDataBase.create_database(dbpath)
@info "" db
@test PSBoardDataBase.insert_qaqc_campaign_id(db) |> isnothing
@test PSBoardDataBase.insert_qaqc_positions(db) |> isnothing
single_result_df =
CSV.read("input/PS board QAQC Data Base - 本番1回試験・追加検証試験.csv", DataFrame)
runlist_table = CSV.read("input/PS board QAQC Data Base - RUNLIST.csv", DataFrame)
@test PSBoardDataBase.prepare_single_result_df(single_result_df) isa DataFrame
@test PSBoardDataBase.add_psboard_ids(db, single_result_df) |> isnothing
@test PSBoardDataBase.add_qaqc_runlist(db, runlist_table) |> isnothing
@test PSBoardDataBase.add_qaqc_single_result(db, single_result_df, runlist_table) |>
isnothing
run(`sqlitebrowser $dbpath`)
end