PSBoardDataBase/test/runtests.jl
Wataru Otsubo eba8d8f395 new: create tables & add campaigns, runs, ps_boards, single run results
- currently, test automatically opens sqlitebrowser
- ext package is not well checked
2024-09-12 20:26:38 +09:00

28 lines
958 B
Julia

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