From d02e79c0cddd986a0b2cef878f32bda39cc2f5e9 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 04:30:31 +0900 Subject: test: port SecurityAdvisoryPoolFilter, downloader/command/app stubs All ignored/todo!(): the advisory filter parses affectedVersions via a look-around regex; the Hg/Fossil/Perforce/Archive downloaders and RepositoryManager need mocked process/HttpDownloader (curl); the Validate/ Archive commands, ApplicationTest and CompletionFunctionalTest need the ApplicationTester/console harness. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../tests/downloader/archive_downloader_test.rs | 40 ++++++++++++++++++++++ .../tests/downloader/fossil_downloader_test.rs | 40 ++++++++++++++++++++++ .../shirabe/tests/downloader/hg_downloader_test.rs | 40 ++++++++++++++++++++++ crates/shirabe/tests/downloader/main.rs | 4 +++ .../tests/downloader/perforce_downloader_test.rs | 27 +++++++++++++++ 5 files changed, 151 insertions(+) (limited to 'crates/shirabe/tests/downloader') diff --git a/crates/shirabe/tests/downloader/archive_downloader_test.rs b/crates/shirabe/tests/downloader/archive_downloader_test.rs index 54ac321..2c0e2de 100644 --- a/crates/shirabe/tests/downloader/archive_downloader_test.rs +++ b/crates/shirabe/tests/downloader/archive_downloader_test.rs @@ -1 +1,41 @@ //! ref: composer/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php + +// These exercise getFileName/processUrl on an anonymous ArchiveDownloader subclass built +// with a mocked IO and a real HttpDownloader (curl_multi_init is todo!()), and pass mocked +// packages. + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_get_file_name() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url2() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url3() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url_rewrite_dist() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url_rewrite_bitbucket_dist() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/fossil_downloader_test.rs b/crates/shirabe/tests/downloader/fossil_downloader_test.rs index 827d634..89e0a9d 100644 --- a/crates/shirabe/tests/downloader/fossil_downloader_test.rs +++ b/crates/shirabe/tests/downloader/fossil_downloader_test.rs @@ -1 +1,41 @@ //! ref: composer/tests/Composer/Test/Downloader/FossilDownloaderTest.php + +// Every case constructs a FossilDownloader with a mocked IO/Config and a mocked +// ProcessExecutor to feed fossil command output; a real HttpDownloader reaches +// curl_multi_init (todo!()), and ProcessExecutor mocking is not available. + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_install_for_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_install() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_updatefor_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_update() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_remove() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_get_installation_source() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/hg_downloader_test.rs b/crates/shirabe/tests/downloader/hg_downloader_test.rs index bf08c1a..23c09f9 100644 --- a/crates/shirabe/tests/downloader/hg_downloader_test.rs +++ b/crates/shirabe/tests/downloader/hg_downloader_test.rs @@ -1 +1,41 @@ //! ref: composer/tests/Composer/Test/Downloader/HgDownloaderTest.php + +// Every case constructs an HgDownloader with a mocked IO/Config and a mocked +// ProcessExecutor to feed hg command output; a real HttpDownloader reaches +// curl_multi_init (todo!()), and ProcessExecutor mocking is not available. + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_download_for_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_download() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_updatefor_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_update() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_remove() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_get_installation_source() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/main.rs b/crates/shirabe/tests/downloader/main.rs index 97f2ee4..cf52ccd 100644 --- a/crates/shirabe/tests/downloader/main.rs +++ b/crates/shirabe/tests/downloader/main.rs @@ -1 +1,5 @@ +mod archive_downloader_test; +mod fossil_downloader_test; +mod hg_downloader_test; +mod perforce_downloader_test; mod xz_downloader_test; diff --git a/crates/shirabe/tests/downloader/perforce_downloader_test.rs b/crates/shirabe/tests/downloader/perforce_downloader_test.rs index 97f45ca..41ced48 100644 --- a/crates/shirabe/tests/downloader/perforce_downloader_test.rs +++ b/crates/shirabe/tests/downloader/perforce_downloader_test.rs @@ -1 +1,28 @@ //! ref: composer/tests/Composer/Test/Downloader/PerforceDownloaderTest.php + +// These mock Perforce, the repository config and a Package to drive PerforceDownloader's +// initialization and install paths; mocking is not available here. + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_init_perforce_instantiates_a_new_perforce_object() { + todo!() +} + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_init_perforce_does_nothing_if_perforce_already_set() { + todo!() +} + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_do_install_with_tag() { + todo!() +} + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_do_install_with_no_tag() { + todo!() +} -- cgit v1.3.1