new: fix & add dispatch_table

This commit is contained in:
Wataru Otsubo 2024-09-12 21:36:13 +09:00 committed by qwjyh
parent ecbb3daa14
commit cb6e50b7dc
3 changed files with 82 additions and 15 deletions

View file

@ -5,24 +5,36 @@ using CSV, DataFrames
true || include("../src/PSBoardDataBase.jl")
@testset "PSBoardDataBase" begin
dbpath = tempname()
db = PSBoardDataBase.create_database(dbpath)
@info "" db
@testset "prepare dataframe" begin
@test PSBoardDataBase.prepare_dispatch_table(
CSV.read("input/PS board QAQC Data Base - 出荷.csv", DataFrame),
) isa DataFrame
end
@test PSBoardDataBase.insert_qaqc_campaign_id(db) |> isnothing
@test PSBoardDataBase.insert_qaqc_positions(db) |> isnothing
@testset "full integrated test" begin
dbpath = tempname()
db = PSBoardDataBase.create_database(dbpath)
@info "" db
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.insert_qaqc_campaign_id(db) |> isnothing
@test PSBoardDataBase.insert_qaqc_positions(db) |> isnothing
@test PSBoardDataBase.prepare_single_result_df(single_result_df) isa DataFrame
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.add_psboard_ids(db, single_result_df) |> isnothing
@test PSBoardDataBase.add_qaqc_runlist(db, runlist_table) |> isnothing
@test PSBoardDataBase.prepare_single_result_df(single_result_df) isa DataFrame
@test PSBoardDataBase.add_qaqc_single_result(db, single_result_df, runlist_table) |>
isnothing
@test PSBoardDataBase.add_psboard_ids(db, single_result_df) |> isnothing
@test PSBoardDataBase.add_qaqc_runlist(db, runlist_table) |> isnothing
run(`sqlitebrowser $dbpath`)
@test PSBoardDataBase.add_qaqc_single_result(db, single_result_df, runlist_table) |>
isnothing
dispatch_table = CSV.read("input/PS board QAQC Data Base - 出荷.csv", DataFrame)
@test PSBoardDataBase.add_qaqcdispatch(db, dispatch_table) |> isnothing
run(`sqlitebrowser $dbpath`)
end
end