Skip to content

Commit

Permalink
GH-55 # Fix integration tests
Browse files Browse the repository at this point in the history
Tranco do not have the same format as alexa, which was the root of the problem.
Indeed tranco do not specify the ip scanned.
  • Loading branch information
Hugo-C committed Apr 21, 2024
1 parent 9f117e2 commit cb83e3a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ pub fn alexa_top1m_path() -> &'static Path {

#[fixture]
#[once]
pub fn set_env_var_top1m_path(alexa_top1m_path: &'static Path) -> &'static Path {
pub fn tranco_top1m_path() -> &'static Path {
Path::new("tests/fixtures_data/tranco_top1M.csv")
}

#[fixture]
#[once]
pub fn set_env_var_top1m_path(alexa_top1m_path: &'static Path, tranco_top1m_path: &'static Path) -> &'static Path {
env::set_var("ALEXA_TOP1M_RAW_DATA_PATH", alexa_top1m_path.to_str().expect("valid path"));
// Tranco and alexa share the same format
env::set_var("FORCE_TRANCO_TOP1M_RAW_DATA_PATH", alexa_top1m_path.to_str().expect("valid path"));
env::set_var("FORCE_TRANCO_TOP1M_RAW_DATA_PATH", tranco_top1m_path.to_str().expect("valid path"));
alexa_top1m_path
}

Expand Down
12 changes: 12 additions & 0 deletions tests/fixtures_data/tranco_top1M.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1,google.com,29d3fd00029d29d21c42d43d00041d188e8965256b2536432a9bd447ae607f
2,youtube.com,29d3fd00029d29d21c42d43d00041d188e8965256b2536432a9bd447ae607f
3,baidu.com,29d29d00029d29d1fc29d29d29d29d881e59db99b9f67f908be168829ecef9
4,facebook.com,27d27d27d0000001dc41d43d00041d1c5ac8aa552261ba8fd1aa9757c06fa5
5,bilibili.com,29d29d15d29d29d21c29d29d29d29d1440cf1827095a54ae723a85f89327ea
6,qq.com,29d29d20d29d29d21c29d29d29d29d323d0777ec827869a2c288e0f199d8ba
7,yahoo.com,27d27d27d3fd27d1dc41d41d000000937221baefa0b90420c8e8e41903f1d5
8,instagram.com,27d27d27d0000001dc41d43d00041d1c5ac8aa552261ba8fd1aa9757c06fa5
9,zhihu.com,3fd3fd20d3fd3fd21c3fd3fd3fd3fd2b66a312d81ed1efa0f55830f7490cb2
10,twitter.com,29d29d00029d29d00042d43d00041d598ac0c1012db967bb1ad0ff2491b3ae
11,fake_site_1.com,21d19d00021d21d00021d19d21d21d1a46380b04d662f0848f508dd171125d
12,fake_site_2.com,21d19d00021d21d00021d19d21d21d1a46380b04d662f0848f508dd171125d

0 comments on commit cb83e3a

Please sign in to comment.