Skip to content

Conversation

@bhq12
Copy link

@bhq12 bhq12 commented Jul 16, 2025

Fix #28

Replicated issue before the fix against google.com:

Screenshot 2025-07-16 at 2 22 01 PM

Confirmed after re-building that semantifly works as expected against bing.com

Screenshot 2025-07-16 at 2 21 03 PM

Confirmed postgres index table contains the complete bing metadata (with the bad google.com entry from pre-fix commands):

Screenshot 2025-07-16 at 2 24 22 PM

Subcommand tests still passing after change (note I had to update the echo.jsontest.com calls in the tests to api.github.com instead as I was having DNS issues with echo.jsontest.com, unsure if this is a my-network thing though so haven't included that change in the PR):

go test . -v
=== RUN   TestAdd
--- Testing Add command ---
--- PASS: TestAdd (0.03s)
=== RUN   TestAdd_MultipleFilesSamePath
--- PASS: TestAdd_MultipleFilesSamePath (0.01s)
=== RUN   TestAdd_Webpage
--- PASS: TestAdd_Webpage (2.41s)
=== RUN   TestAdd_Database
--- PASS: TestAdd_Database (0.01s)
=== RUN   TestDelete
--- Testing Delete command ---
--- PASS: TestDelete (0.01s)
=== RUN   TestGet
--- Testing Get command ---
--- PASS: TestGet (0.01s)
=== RUN   TestGet_Webpage
--- PASS: TestGet_Webpage (1.14s)
=== RUN   TestGet_Database
--- PASS: TestGet_Database (1.24s)
=== RUN   TestLexicalSearch
--- Testing LexicalSearch command ---
=== RUN   TestLexicalSearch/Search_for_'test'
=== RUN   TestLexicalSearch/Search_for_'search'
=== RUN   TestLexicalSearch/Search_for_non-existent_term
--- PASS: TestLexicalSearch (0.00s)
    --- PASS: TestLexicalSearch/Search_for_'test' (0.00s)
    --- PASS: TestLexicalSearch/Search_for_'search' (0.00s)
    --- PASS: TestLexicalSearch/Search_for_non-existent_term (0.00s)
=== RUN   TestLexicalSearch_NonExistentIndex
--- PASS: TestLexicalSearch_NonExistentIndex (0.00s)
=== RUN   TestLexicalSearch_UnexpectedTopN
--- PASS: TestLexicalSearch_UnexpectedTopN (0.00s)
=== RUN   TestPrintSearchResults
--- PASS: TestPrintSearchResults (0.00s)
=== RUN   TestParseArgs
=== RUN   TestParseArgs/Simple_flag_and_non-flag_arguments
=== RUN   TestParseArgs/Flags_with_equal_sign
=== RUN   TestParseArgs/Boolean_flag
=== RUN   TestParseArgs/Boolean_flag_v2
=== RUN   TestParseArgs/Complicated_bool_flags
=== RUN   TestParseArgs/Multiple_flags_and_non-flag_arguments
=== RUN   TestParseArgs/No_flags,_only_non-flag_arguments
=== RUN   TestParseArgs/Only_flags,_no_non-flag_arguments
=== RUN   TestParseArgs/Complicated_test:_different_types_of_flags_and_order_of_arguments
=== RUN   TestParseArgs/No_args
--- PASS: TestParseArgs (0.00s)
    --- PASS: TestParseArgs/Simple_flag_and_non-flag_arguments (0.00s)
    --- PASS: TestParseArgs/Flags_with_equal_sign (0.00s)
    --- PASS: TestParseArgs/Boolean_flag (0.00s)
    --- PASS: TestParseArgs/Boolean_flag_v2 (0.00s)
    --- PASS: TestParseArgs/Complicated_bool_flags (0.00s)
    --- PASS: TestParseArgs/Multiple_flags_and_non-flag_arguments (0.00s)
    --- PASS: TestParseArgs/No_flags,_only_non-flag_arguments (0.00s)
    --- PASS: TestParseArgs/Only_flags,_no_non-flag_arguments (0.00s)
    --- PASS: TestParseArgs/Complicated_test:_different_types_of_flags_and_order_of_arguments (0.00s)
    --- PASS: TestParseArgs/No_args (0.00s)
=== RUN   TestServerCommands
2025/07/16 17:53:15 server listening at [::]:50051
2025/07/16 17:53:15 using index path: ./test_semantifly
--- PASS: TestServerCommands (0.12s)
=== RUN   TestHelpFlag
=== RUN   TestHelpFlag/--help
=== RUN   TestHelpFlag/-h
--- PASS: TestHelpFlag (0.02s)
    --- PASS: TestHelpFlag/--help (0.01s)
    --- PASS: TestHelpFlag/-h (0.01s)
=== RUN   TestAddSubcommand
=== RUN   TestAddSubcommand/Help
=== RUN   TestAddSubcommand/Non-existing_file
=== RUN   TestAddSubcommand/Bad_flag
=== RUN   TestAddSubcommand/Existing_file
=== RUN   TestAddSubcommand/Creates_new_directory_for_index
--- PASS: TestAddSubcommand (0.05s)
    --- PASS: TestAddSubcommand/Help (0.01s)
    --- PASS: TestAddSubcommand/Non-existing_file (0.01s)
    --- PASS: TestAddSubcommand/Bad_flag (0.01s)
    --- PASS: TestAddSubcommand/Existing_file (0.01s)
    --- PASS: TestAddSubcommand/Creates_new_directory_for_index (0.01s)
=== RUN   TestGetSubcommand
=== RUN   TestGetSubcommand/Get_existing_file
=== RUN   TestGetSubcommand/Get_after_delete
=== RUN   TestGetSubcommand/Get_bad_index_file
--- PASS: TestGetSubcommand (0.05s)
    --- PASS: TestGetSubcommand/Get_existing_file (0.01s)
    --- PASS: TestGetSubcommand/Get_after_delete (0.02s)
    --- PASS: TestGetSubcommand/Get_bad_index_file (0.02s)
=== RUN   TestUpdateSubcommand
=== RUN   TestUpdateSubcommand/Update_without_URI
=== RUN   TestUpdateSubcommand/Update_with_new_file
--- PASS: TestUpdateSubcommand (0.03s)
    --- PASS: TestUpdateSubcommand/Update_without_URI (0.01s)
    --- PASS: TestUpdateSubcommand/Update_with_new_file (0.01s)
=== RUN   TestDeleteSubcommand
=== RUN   TestDeleteSubcommand/Delete_bad_index_file
=== RUN   TestDeleteSubcommand/Delete_existing_file
=== RUN   TestDeleteSubcommand/Delete_from_empty_index
--- PASS: TestDeleteSubcommand (0.04s)
    --- PASS: TestDeleteSubcommand/Delete_bad_index_file (0.01s)
    --- PASS: TestDeleteSubcommand/Delete_existing_file (0.01s)
    --- PASS: TestDeleteSubcommand/Delete_from_empty_index (0.01s)
=== RUN   TestWebpageOperations
=== RUN   TestWebpageOperations/Add_webpage
=== RUN   TestWebpageOperations/Get_webpage
=== RUN   TestWebpageOperations/Update_webpage
=== RUN   TestWebpageOperations/Get_webpage#01
=== RUN   TestWebpageOperations/Delete_webpage
--- PASS: TestWebpageOperations (7.38s)
    --- PASS: TestWebpageOperations/Add_webpage (2.17s)
    --- PASS: TestWebpageOperations/Get_webpage (1.71s)
    --- PASS: TestWebpageOperations/Update_webpage (1.51s)
    --- PASS: TestWebpageOperations/Get_webpage#01 (1.98s)
    --- PASS: TestWebpageOperations/Delete_webpage (0.01s)
=== RUN   TestUpdate
--- Testing Update command ---
--- PASS: TestUpdate (0.01s)
=== RUN   TestUpdate_Database
--- PASS: TestUpdate_Database (0.01s)
PASS
ok      accretional.com/semantifly/subcommands  25.836s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adds that fail to read a source (due to incorrect input etc) still create bad entries that are empty

1 participant