add CSV download functions and set them as default and use in test

- replaced old ones from runtests
- need to remove CSVs in git repo
This commit is contained in:
Wataru Otsubo 2024-10-01 10:52:47 +09:00
parent 16d23ec4bb
commit d58a13793f
5 changed files with 107 additions and 14 deletions

View file

@ -16,17 +16,39 @@ true || include("../src/PSBoardDataBase.jl")
@test masterlog_metadata.shiftscript_version == v"1.0.2"
end
@testset "Download data csv" begin
out = tempname()
@test CSV.read(
PSBoardDataBase.DownloadCSVs.download_single_run_csv(out),
DataFrame,
) isa DataFrame
@test CSV.read(
PSBoardDataBase.DownloadCSVs.download_runlist_csv(out),
DataFrame,
) isa DataFrame
@test CSV.read(
PSBoardDataBase.DownloadCSVs.download_dispatch_csv(out),
DataFrame,
) isa DataFrame
@test CSV.read(
PSBoardDataBase.DownloadCSVs.download_hundred_run_csv(out),
DataFrame,
) isa DataFrame
@test CSV.read(PSBoardDataBase.DownloadCSVs.download_jathub_csv(out), DataFrame) isa
DataFrame
end
@testset "prepare dataframe" begin
single_result_df =
CSV.read("input/PS board QAQC Data Base - 本番1回試験・追加検証試験.csv", DataFrame)
CSV.read(PSBoardDataBase.DownloadCSVs.download_single_run_csv(), DataFrame)
@test PSBoardDataBase.prepare_single_result_df(single_result_df) isa DataFrame
@test PSBoardDataBase.prepare_dispatch_table(
CSV.read("input/PS board QAQC Data Base - 出荷.csv", DataFrame),
CSV.read(PSBoardDataBase.DownloadCSVs.download_dispatch_csv(), DataFrame),
) isa DataFrame
@test PSBoardDataBase.prepare_100test_table(
CSV.read("input/PS board QAQC Data Base - 100回試験結果.csv", DataFrame),
CSV.read(PSBoardDataBase.DownloadCSVs.download_hundred_run_csv(), DataFrame),
) isa DataFrame
end
@ -48,12 +70,14 @@ true || include("../src/PSBoardDataBase.jl")
end
@test PSBoardDataBase.insert_qaqc_campaign_id(db) |> isnothing
jathub_list_df = CSV.read("input/PS board QAQC Data Base - JATHub db.csv", DataFrame)
jathub_list_df =
CSV.read(PSBoardDataBase.DownloadCSVs.download_jathub_csv(), DataFrame)
@test PSBoardDataBase.insert_qaqc_positions(db, jathub_list_df) |> 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)
CSV.read(PSBoardDataBase.DownloadCSVs.download_single_run_csv(), DataFrame)
runlist_table =
CSV.read(PSBoardDataBase.DownloadCSVs.download_runlist_csv(), DataFrame)
@test PSBoardDataBase.add_psboard_ids(db, single_result_df) |> isnothing
@test PSBoardDataBase.add_qaqc_runlist_from_runlist(db, runlist_table) |> isnothing
@ -61,7 +85,8 @@ true || include("../src/PSBoardDataBase.jl")
@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)
dispatch_table =
CSV.read(PSBoardDataBase.DownloadCSVs.download_dispatch_csv(), DataFrame)
@test PSBoardDataBase.add_qaqc_dispatch(db, dispatch_table) |> isnothing
@ -70,7 +95,7 @@ true || include("../src/PSBoardDataBase.jl")
isnothing
extra_100test_result_df =
CSV.read("input/PS board QAQC Data Base - 100回試験結果.csv", DataFrame)
CSV.read(PSBoardDataBase.DownloadCSVs.download_hundred_run_csv(), DataFrame)
@test PSBoardDataBase.add_qaqc_100test_result(db, extra_100test_result_df) |>
isnothing