From edb68d322c831a591bc47514c5d36e6173de385e Mon Sep 17 00:00:00 2001 From: Enan Ajmain <3nan.ajmain@gmail.com> Date: Sun, 20 Aug 2023 23:44:57 +0600 Subject: [PATCH] fix(test): remove backdated unit test and CI --- .github/workflows/ci.yml | 43 ---------------------------------------- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 39 ------------------------------------ 4 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index db00fcc..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: CI -on: - push: - branches: - - 'master' - - 'release-[0-9]+.[0-9]+' - - 'ci/*' - -jobs: - build: - name: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-22.04, windows-2022 ] - include: - - os: ubuntu-22.04 - target: x86_64-unknown-linux-musl - - os: windows-2022 - target: x86_64-pc-windows-msvc - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: Cache Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - - if: matrix.os == 'ubuntu-22.04' - name: Install MUSL toolchain - run: | - sudo apt update - sudo apt install -y musl-tools - rustup target add x86_64-unknown-linux-musl - - name: Build ${{ github.repository }} - run: cargo build --target ${{ matrix.target }} - - name: Run unit tests - run: cargo test --target ${{ matrix.target }} diff --git a/Cargo.lock b/Cargo.lock index 938aeaf..397bfc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -809,7 +809,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "twitchlink" -version = "1.0.0" +version = "1.0.1" dependencies = [ "dirs", "regex", diff --git a/Cargo.toml b/Cargo.toml index d98bb04..f67cda3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "twitchlink" -version = "1.0.0" +version = "1.0.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 251cfaa..6b75a4f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -225,42 +225,3 @@ fn main() { print_stream_links(user_arg); } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_estimate_vod_link() { - let vod_info = r#" -{ - "data": [ - { - "created_at": "2023-04-26T17:03:25Z", - "description": "", - "duration": "6h46m38s", - "id": "1804186756", - "language": "en", - "muted_segments": null, - "published_at": "2023-04-26T17:03:25Z", - "stream_id": "48380328493", - "thumbnail_url": "https://static-cdn.jtvnw.net/cf_vods/d1m7jfoe9zdc1j/51b4df78ae6d180ce585_elizabethzaks_48380328493_1682528600//thumb/thumb0-%{width}x%{height}.jpg", - "title": "RE8 FINALE AND SPOOKS W/ @nikkiblackketter !socials", - "type": "archive", - "url": "https://www.twitch.tv/videos/1804186756", - "user_id": "214714452", - "user_login": "elizabethzaks", - "user_name": "ElizabethZaks", - "view_count": 1262, - "viewable": "public" - } - ], - "pagination": {} -}"#; - - let vod_link = estimate_vod_link(vod_info.to_string()) - .expect("[FAIL] Cannot estimate VOD link."); - println!("{}", vod_link); - assert_eq!(vod_link, "https://d1m7jfoe9zdc1j.cloudfront.net/51b4df78ae6d180ce585_elizabethzaks_48380328493_1682528600/720p60/index-dvr.m3u8"); - } -}