[Ludiafuncs-hackers] Add integration test(ludia_funcs+pg_bigm )

Back to archive index

Fujii Masao masao****@gmail*****
2015年 9月 4日 (金) 11:14:42 JST


On Fri, Sep 4, 2015 at 10:28 AM,  <ishii****@nttda*****> wrote:
> Hi,
>
> I attached regression test patch.
>
> This patch includes integration test(pg_bigm + ludia_funcs).
> This test succeed with both PG9.1 and PG9.4.
>
> The user can test by using following command.
>     make installcheck TEXTPORTER=** PGS2_DEBUG=1 PG_BIGM=1
>
> Could you review patch?
> If the patch has unnecessary tests, please comment.

+ifdef PG_BIGM
+  ifdef TEXTPORTER
+    ifdef PGS2_DEBUG
+    REGRESS += pg_bigm
+    endif
+  endif
+endif

Please imagine the case where we compiled ludia_funcs without PG_BIGM flag.
In this case, if we want to run the regression test with pg_bigm, we need to
recompile the module with PG_BIGM flag. OTOH, please imagine the case where
the module was compiled with PG_BIGM flag. In this case, if we decided not to
install pg_bigm extension, the regression test for ludia_funcs always fails.
So we need to recompile the module without PG_BIGM flag. These seem messy.
So I'd like to add new regression test command like "make installcheck-bigm"
rather than adding new PG_BIGM flag.

If the regression test with pg_bigm contains the tests which we can run only
when the module was compiled with PGS2_DEBUG or TEXTPORTER, I think that
those tests should be separated into different ones like ludia_funcs.sql,
pgs2-debug.sql and textporter.sql. That is, only when ludia_funcs was compiled
with PGS2_DEBUG flag, "make installcheck-bigm" runs the tests using pgs2_debug
option in addtion to the normal tests. Thought?

+-- Test the case where textporter get text from variaus file type.
+CREATE TABLE textporter_sample (filehonbun text);
+INSERT INTO textporter_sample(filehonbun) VALUES
(pgs2textporter1('@abs_srcdir@/data/word2007_test.docx'));
+INSERT INTO textporter_sample(filehonbun) VALUES
(pgs2textporter1('@abs_srcdir@/data/excel2007_test.xlsx'));
+INSERT INTO textporter_sample(filehonbun) VALUES
(pgs2textporter1('@abs_srcdir@/data/powerpoint2007_test.pptx'));
+INSERT INTO textporter_sample(filehonbun) VALUES
(pgs2textporter1('@abs_srcdir@/data/pdf1.5_test.pdf'));
+INSERT INTO textporter_sample(filehonbun) VALUES
(pgs2textporter1('@abs_srcdir@/data/text_test.txt'));
+INSERT INTO textporter_sample(filehonbun) VALUES
(pgs2textporter1('@abs_srcdir@/data/csv_test.csv'));
+
+SELECT * FROM textporter_sample;

Since these tests are not directly related to pg_bigm, I think that
they should be included in the regression tests for textporter.
Thought?

+\copy char_tbl from @abs_srcdir@/data/test_tbl.txt

Since \copy is executed in the client side, you don't need to use @abs_srcdir@
trick to specify the input data directory path.

Regards,

-- 
Fujii Masao




Ludiafuncs-hackers メーリングリストの案内
Back to archive index