Compare commits
6 commits
main
...
feat/oauth
Author | SHA1 | Date | |
---|---|---|---|
4e5fb1d898 | |||
a9b33fb882 | |||
5459b88660 | |||
e457733244 | |||
e5ca368d3f | |||
d2df0f2b06 |
3 changed files with 27 additions and 13 deletions
|
@ -29,10 +29,14 @@ jobs:
|
|||
|
||||
- name: 🧪 Test
|
||||
run: |
|
||||
echo "${{ secrets.RUSTYPIPE_CACHE }}" > rustypipe_cache.json
|
||||
printf "$RUSTYPIPE_CACHE" > rustypipe_cache.json
|
||||
ls
|
||||
head -n 1 rustypipe_cache.json
|
||||
RUST_LOG=debug cargo test --package rustypipe --test youtube --features rss -- user_login --exact --nocapture
|
||||
cargo nextest run --config-file ~/.config/nextest.toml --profile ci --retries 2 --features rss --workspace
|
||||
env:
|
||||
ALL_PROXY: "http://warpproxy:8124"
|
||||
RUSTYPIPE_CACHE: "${{ secrets.RUSTYPIPE_CACHE }}"
|
||||
|
||||
- name: 💌 Upload test report
|
||||
if: always()
|
||||
|
|
|
@ -605,17 +605,17 @@ impl RustyPipeBuilder {
|
|||
Box::new(FileStorage::new(cache_file))
|
||||
});
|
||||
|
||||
let mut cdata = storage
|
||||
.as_ref()
|
||||
.and_then(|storage| storage.read())
|
||||
.and_then(|data| match serde_json::from_str::<CacheData>(&data) {
|
||||
Ok(data) => Some(data),
|
||||
let mut cdata = if let Some(data) = storage.as_ref().and_then(|storage| storage.read()) {
|
||||
match serde_json::from_str::<CacheData>(&data) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
tracing::error!("Could not deserialize cache. Error: {}", e);
|
||||
None
|
||||
CacheData::default()
|
||||
}
|
||||
})
|
||||
.unwrap_or_default();
|
||||
}
|
||||
} else {
|
||||
CacheData::default()
|
||||
};
|
||||
|
||||
let cache_clients = [
|
||||
ClientType::Desktop,
|
||||
|
|
|
@ -7,6 +7,7 @@ use std::str::FromStr;
|
|||
use rstest::{fixture, rstest};
|
||||
use rustypipe::param::{AlbumOrder, LANGUAGES};
|
||||
use time::{macros::date, OffsetDateTime};
|
||||
use tracing_test::traced_test;
|
||||
|
||||
use rustypipe::client::{ClientType, RustyPipe, RustyPipeQuery};
|
||||
use rustypipe::error::{Error, ExtractionError, UnavailabilityReason};
|
||||
|
@ -246,10 +247,10 @@ async fn get_player(
|
|||
#[case] is_live_content: bool,
|
||||
rp: RustyPipe,
|
||||
) {
|
||||
if id == "ZDKQmBWTRnw" && !rp.query().auth_enabled() {
|
||||
tracing::warn!("unauthenticated; age-limited video cannot be tested");
|
||||
return;
|
||||
}
|
||||
// if id == "ZDKQmBWTRnw" && !rp.query().auth_enabled() {
|
||||
// tracing::warn!("unauthenticated; age-limited video cannot be tested");
|
||||
// return;
|
||||
// }
|
||||
|
||||
let player_data = rp.query().player(id).await.unwrap();
|
||||
let details = player_data.details;
|
||||
|
@ -2675,6 +2676,15 @@ async fn isrc_search_languages(rp: RustyPipe) {
|
|||
}
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
#[traced_test]
|
||||
async fn user_login(rp: RustyPipe) {
|
||||
tracing::debug!("test");
|
||||
assert!(rp.query().auth_enabled());
|
||||
rp.user_auth_check_login().await.unwrap();
|
||||
}
|
||||
|
||||
//#TESTUTIL
|
||||
|
||||
/// Get the language setting from the environment variable
|
||||
|
|
Loading…
Reference in a new issue