davidfstr / Crystal-Web-Archiver

Downloads websites for long-term archival.
http://dafoster.net/projects/crystal-web-archiver
60 stars 5 forks source link

Tests: Don't fail when real Crystal app is already open and serving content #188

Open davidfstr opened 9 months ago

davidfstr commented 9 months ago

Currently the test suite makes a hard assumption that the default serving port (2797) is open at the time that tests are run.

However if a real version of Crystal is running and serving content on the default port at the time that tests start running, that assumption will not be correct and various tests will fail.

Screen Shot 2024-01-28 at 4 04 14 PM

Affected tests:

crystal --test crystal.tests.test_load_urls.test_serve_url_never_requires_loading_urls crystal.tests.test_project_migrate.test_can_serve_revisions_from_project_with_major_version_1 crystal.tests.test_project_migrate.test_can_serve_revisions_from_project_with_major_version_2 crystal.tests.test_server.test_when_serve_page_then_safe_headers_included crystal.tests.test_server.test_when_serve_page_then_unsafe_headers_excluded crystal.tests.test_server.test_when_serve_page_with_unknown_non_x_header_then_excludes_header_and_prints_warning crystal.tests.test_server.test_when_serve_page_with_unknown_x_header_then_excludes_header_silently crystal.tests.test_workflows.test_can_download_and_serve_a_static_site crystal.tests.test_workflows.test_can_download_and_serve_a_site_requiring_dynamic_url_discovery crystal.tests.test_workflows.test_can_download_and_serve_a_site_requiring_dynamic_link_rewriting crystal.tests.test_workflows.test_cannot_download_anything_given_project_is_opened_as_readonly crystal.tests.test_workflows.test_can_update_downloaded_site_with_newer_page_revisions