<commit_before>if(BUILD_TESTING)
  site_name(host_name)
  set(midascli_command "${MIDASCPP_BINARY_DIR}/bin/MIDAScli")
  set(sqlite3_command "${MIDASCPP_BINARY_DIR}/bin/sqlite3")
  set(dashboard_midas_server_url http://${host_name}/midas/api/rest)
  set(dashboard_midas_api_key NO_KEY CACHE STRING "The MIDAS API key for test dashboard")
  set(dashboard_midas_app_name test CACHE STRING "The MIDAS API name for test dashboard")
  set(dashboard_midas_email admin@localhost CACHE STRING "The MIDAS login email for test dashboard")
  site_name(dashboard_top_level_community_name)
  
    # Setup a mock tree we can add
  configure_file(
    "${MIDASCPP_SOURCE_DIR}/README.txt"
    "${MIDASCPP_BINARY_DIR}/Testing/${top_level_community_name}/Subcomm/Collection/Item/bitstream.txt"
    COPYONLY)

  # Add target to copy our database to the testing dir during build
  add_custom_command (
    TARGET sqlite_db
    POST_BUILD
    COMMAND "${CMAKE_CMAKE_COMMAND}" -E copy "${MIDASCPP_BINARY_DIR}/midas.db" "${MIDASCPP_BINARY_DIR}/Testing/midas.db"
    COMMENT "Copying SQLite database into Test dir..."
  )

  add_test(testCliNoArgs ${midascli_command})
  set_tests_properties(testCliNoArgs PROPERTIES WILL_FAIL ON)

  # Restore database to a fresh state
  add_test(cleanDatabase ${midascli_command} clean)
  add_test(deleteAuthProfiles ${sqlite3_command} midas.db "DELETE FROM auth_profile;")

  # "clone" command tests
  add_test(testClone ${midascli_command} clone ${midas_server_url})
  set_tests_properties(testClone PROPERTIES DEPENDS "cleanDatabase;deleteAuthProfiles")

  # "create_profile" command tests
  add_test(testCreateProfile ${midascli_command} create_profile --name test --email ${dashboard_midas_email} --app-name ${dashboard_midas_app_name} --api-key ${dashboard_midas_api_key})
  set_tests_properties(testCreateProfile PROPERTIES DEPENDS testClone)

  add_test(testPushNoResources ${midascli_command} --profile test push)
  set_tests_properties(testPushNoResources PROPERTIES DEPENDS testCreateProfile)

  # Restore database to a fresh state again
  add_test(cleanDatabase2 ${midascli_command} clean)
  set_tests_properties(cleanDatabase2 PROPERTIES DEPENDS testPushNoResources)

  # "add" command tests
  add_test(testAddTopLevelCommunity ${midascli_command} add -C "${dashboard_top_level_community_name}")
  set_tests_properties(testAddTopLevelCommunity PROPERTIES DEPENDS cleanDatabase2)
  add_test(testAddSubCommunity ${midascli_command} add -C "${dashboard_top_level_community_name}/Subcomm")
  set_tests_properties(testAddSubCommunity PROPERTIES DEPENDS testAddTopLevelCommunity)
  add_test(testAddCollection ${midascli_command} add -c "${dashboard_top_level_community_name}/Subcomm/Collection")
  set_tests_properties(testAddCollection PROPERTIES DEPENDS testAddSubCommunity)
  add_test(testAddItem ${midascli_command} add -i "${dashboard_top_level_community_name}/Subcomm/Collection/Item")
  set_tests_properties(testAddItem PROPERTIES DEPENDS testAddCollection)
  add_test(testAddBitstream ${midascli_command} add -b "${dashboard_top_level_community_name}/Subcomm/Collection/Item/bitstream.txt")
  set_tests_properties(testAddBitstream PROPERTIES DEPENDS testAddItem)

  # "push" command tests
  add_test(testPushNoAuth ${midascli_command} push)
  set_tests_properties(testPushNoAuth PROPERTIES DEPENDS testAddBitstream WILL_FAIL ON)
  add_test(testPush ${midascli_command} --profile test push)
  set_tests_properties(testPush PROPERTIES DEPENDS testPushNoAuth)
endif(BUILD_TESTING)
  
<commit_msg>BUG: Fix unit testing of MIDAScli<commit_after>if(BUILD_TESTING)
  set(midascli_command "${MIDASCPP_BINARY_DIR}/bin/MIDAScli")
  set(sqlite3_command "${MIDASCPP_BINARY_DIR}/bin/sqlite3")
  set(dashboard_midas_server_url http://localhost/midas/api/rest CACHE STRING "The URL of the REST API for MIDAS testing")
  set(dashboard_midas_api_key NO_KEY CACHE STRING "The MIDAS API key for test dashboard")
  set(dashboard_midas_app_name test CACHE STRING "The MIDAS API name for test dashboard")
  set(dashboard_midas_email admin@localhost CACHE STRING "The MIDAS login email for test dashboard")
  site_name(dashboard_top_level_community_name)
  
  set(sqlite_db "${MIDASCPP_BINARY_DIR}/midas.db")
  
    # Setup a mock tree we can add
  configure_file(
    "${MIDASCPP_SOURCE_DIR}/README.txt"
    "${MIDASCPP_BINARY_DIR}/Testing/${top_level_community_name}/Subcomm/Collection/Item/bitstream.txt"
    COPYONLY)

  # Add target to copy our database to the testing dir during build
  add_custom_command (
    TARGET sqlite_db
    POST_BUILD
    COMMAND "${CMAKE_CMAKE_COMMAND}" -E copy "${MIDASCPP_BINARY_DIR}/midas.db" "${MIDASCPP_BINARY_DIR}/Testing/midas.db"
    COMMENT "Copying SQLite database into Test dir..."
  )

  add_test(testCliNoArgs ${midascli_command})
  set_tests_properties(testCliNoArgs PROPERTIES WILL_FAIL ON)

  # Restore database to a fresh state
  add_test(cleanDatabase ${midascli_command} clean)
  add_test(deleteAuthProfiles ${sqlite3_command} ${sqlite_db} "DELETE FROM auth_profile;")

  # "clone" command tests
  add_test(testClone ${midascli_command} clone ${dashboard_midas_server_url})
  set_tests_properties(testClone PROPERTIES DEPENDS "cleanDatabase;deleteAuthProfiles")

  # "create_profile" command tests
  add_test(testCreateProfile ${midascli_command} --database ${sqlite_db} create_profile --name test --email ${dashboard_midas_email} --app-name ${dashboard_midas_app_name} --api-key ${dashboard_midas_api_key})
  set_tests_properties(testCreateProfile PROPERTIES DEPENDS testClone)

  add_test(testPushNoResources ${midascli_command} --database ${sqlite_db} --profile test push)
  set_tests_properties(testPushNoResources PROPERTIES DEPENDS testCreateProfile)

  # Restore database to a fresh state again
  add_test(cleanDatabase2 ${midascli_command} --database ${sqlite_db} clean)
  set_tests_properties(cleanDatabase2 PROPERTIES DEPENDS testPushNoResources)

  # "add" command tests
  add_test(testAddTopLevelCommunity ${midascli_command} --database ${sqlite_db} add -C "${dashboard_top_level_community_name}")
  set_tests_properties(testAddTopLevelCommunity PROPERTIES DEPENDS cleanDatabase2)
  add_test(testAddSubCommunity ${midascli_command} --database ${sqlite_db} add -C "${dashboard_top_level_community_name}/Subcomm")
  set_tests_properties(testAddSubCommunity PROPERTIES DEPENDS testAddTopLevelCommunity)
  add_test(testAddCollection ${midascli_command} --database ${sqlite_db} add -c "${dashboard_top_level_community_name}/Subcomm/Collection")
  set_tests_properties(testAddCollection PROPERTIES DEPENDS testAddSubCommunity)
  add_test(testAddItem ${midascli_command} --database ${sqlite_db} add -i "${dashboard_top_level_community_name}/Subcomm/Collection/Item")
  set_tests_properties(testAddItem PROPERTIES DEPENDS testAddCollection)
  add_test(testAddBitstream ${midascli_command} --database ${sqlite_db} add -b "${dashboard_top_level_community_name}/Subcomm/Collection/Item/bitstream.txt")
  set_tests_properties(testAddBitstream PROPERTIES DEPENDS testAddItem)

  # "push" command tests
  add_test(testPushNoAuth ${midascli_command} --database ${sqlite_db} push)
  set_tests_properties(testPushNoAuth PROPERTIES DEPENDS testAddBitstream WILL_FAIL ON)
  add_test(testPush ${midascli_command} --database ${sqlite_db} --profile test push)
  set_tests_properties(testPush PROPERTIES DEPENDS testPushNoAuth)
endif(BUILD_TESTING)
  

{'fraction_non_alphanumeric': 0.0861392832995267, 'fraction_numerical': 0.0016227180527383367, 'mean_word_length': 7.056644880174292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4114006', 'n_tokens_mistral': 2442, 'n_tokens_neox': 2427, 'n_words': 487}