sagiegurari / ci_info

@@ -268,6 +268,14 @@
Loading
268 268
        branch_name_env: None,
269 269
    });
270 270
271 +
    config.push(VendorConfig {
272 +
        name: "SourceHut".to_string(),
273 +
        vendor: Vendor::SourceHut,
274 +
        ci_env: EnvValue::Contains("JOB_URL".to_string(), "builds.sr.ht".to_string()),
275 +
        pr_env: None,
276 +
        branch_name_env: None,
277 +
    });
278 +
271 279
    config.push(VendorConfig {
272 280
        name: "Strider CD".to_string(),
273 281
        vendor: Vendor::StriderCD,

@@ -70,6 +70,8 @@
Loading
70 70
    /// CI vendor
71 71
    SolanoCI,
72 72
    /// CI vendor
73 +
    SourceHut,
74 +
    /// CI vendor
73 75
    StriderCD,
74 76
    /// CI vendor
75 77
    TaskCluster,

@@ -956,6 +956,24 @@
Loading
956 956
    assert!(info.branch_name.is_none());
957 957
}
958 958
959 +
#[test]
960 +
fn get_sourcehut() {
961 +
    let info = get_with_env(TestVendorConfig {
962 +
        ci_env: EnvValue::Value(
963 +
            "JOB_URL".to_string(),
964 +
            "https://builds.sr.ht/~test/job/1".to_string(),
965 +
        ),
966 +
        pr_env: None,
967 +
        branch_name_env: None,
968 +
    });
969 +
970 +
    assert!(info.ci);
971 +
    assert!(info.pr.is_none());
972 +
    assert_eq!(info.vendor.unwrap(), Vendor::SourceHut);
973 +
    assert_eq!(info.name.unwrap(), "SourceHut");
974 +
    assert!(info.branch_name.is_none());
975 +
}
976 +
959 977
#[test]
960 978
fn get_strider_cd() {
961 979
    let info = get_with_env(TestVendorConfig {
Files Coverage
src 95.51%
Project Totals (9 files) 95.51%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading