Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Regression due to Make _search_nextjs_data non fatal #9763

Open
9 of 10 tasks
samoht0 opened this issue Apr 22, 2024 · 4 comments · May be fixed by #9765
Open
9 of 10 tasks

Test Regression due to Make _search_nextjs_data non fatal #9763

samoht0 opened this issue Apr 22, 2024 · 4 comments · May be fixed by #9765
Labels
docs/meta/cleanup related to docs, code cleanup, templates, devscripts etc

Comments

@samoht0
Copy link

samoht0 commented Apr 22, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Provide a description that is worded well enough to be understood

Test regression due to 3ee1194:

=================================== FAILURES ===================================
__________________ TestInfoExtractor.test_search_nextjs_data ___________________

self = <test.test_InfoExtractor.TestInfoExtractor testMethod=test_search_nextjs_data>

def test_search_nextjs_data(self):
    data = '<script id="__NEXT_DATA__" type="application/json">{"props":{}}</script>'
    self.assertEqual(self.ie._search_nextjs_data(data, None), {'props': {}})
    self.assertEqual(self.ie._search_nextjs_data('', None, fatal=False), {})
    self.assertEqual(self.ie._search_nextjs_data('', None, default=None), None)
    self.assertEqual(self.ie._search_nextjs_data('', None, default={}), {})
  with self.assertRaises(DeprecationWarning):

E AssertionError: DeprecationWarning not raised

test/test_InfoExtractor.py:1915: AssertionError
----------------------------- Captured stderr call -----------------------------
WARNING: [Dummy] unable to extract next.js data; please report this issue on https://github.com/yt

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

python -m yt_dlp -v
[debug] Command-line config: ['-v']
[debug] System config "/etc/yt-dlp.conf": ['--prefer-free-formats', '--hls-prefer-native']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff38a011d]
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.8.6-100.fc38.x86_64-x86_64-with-glibc2.37 (OpenSSL 3.0.9 30 May 2023, glibc 2.37)
[debug] exe versions: ffmpeg 6.0.1 (setts), ffprobe 6.0.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.0.9, certifi-2022.09.24, mutagen-1.46.0, requests-2.31.0, sqlite3-3.40.1, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1810 extractors

Usage: __main__.py [OPTIONS] URL [URL...]

__main__.py: error: You must provide at least one URL.
Type yt-dlp --help to see a list of all options.

Non-standard version info: Only commit updated, due to used visioning scheme (rpm-packaged).
@samoht0 samoht0 added bug Bug that is not site-specific triage Untriaged issue labels Apr 22, 2024
@bashonly
Copy link
Member

bashonly commented Apr 22, 2024

Non-standard version info: Only commit updated, due to used visioning scheme (rpm-packaged).

can you elaborate on this?

and how are you running the tests? what command and from which directory?

@bashonly bashonly added incomplete Further information is needed and removed bug Bug that is not site-specific triage Untriaged issue labels Apr 22, 2024
@samoht0
Copy link
Author

samoht0 commented Apr 22, 2024

can you elaborate on this?

Using API to get tarball from commit:
[https://github.com/yt-dlp/yt-dlp/tarball/{commit}]

https://github.com/yt-dlp/yt-dlp/tarball/ff38a011d57b763f3a69bebd25a5dc9044a717ce

and how are you running the tests? what command and from which directory?

  • cd yt-dlp-yt-dlp-ff38a01
  • PATH=/builddir/build/BUILDROOT/yt-dlp-2024.04.09.git.5-ff38a01.fc38.x86_64/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
  • PYTHONPATH=/builddir/build/BUILDROOT/yt-dlp-2024.04.09.git.5-ff38a01.fc38.x86_64/usr/lib64/python3.11/site-packages:/builddir/build/BUILDROOT/yt-dlp-2024.04.09.git.5-ff38a01.fc38.x86_64/usr/lib/python3.11/site-packages
  • PYTHONDONTWRITEBYTECODE=1
  • PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/yt-dlp-yt-dlp-ff38a01/.pyproject-builddir'
  • PYTEST_XDIST_AUTO_NUM_WORKERS=2
  • /usr/bin/pytest -k 'not download'
    ============================= test session starts ==============================
    platform linux -- Python 3.11.8, pytest-7.2.2, pluggy-1.0.0 -- /usr/bin/python3
    cachedir: .pytest_cache
    rootdir: /builddir/build/BUILD/yt-dlp-yt-dlp-ff38a01, configfile: setup.cfg
    collecting ... collected 6640 items / 5745 deselected / 895 selected

@bashonly bashonly added docs/meta/cleanup related to docs, code cleanup, templates, devscripts etc and removed incomplete Further information is needed labels Apr 22, 2024
@Grub4K Grub4K linked a pull request Apr 22, 2024 that will close this issue
6 tasks
@Grub4K
Copy link
Member

Grub4K commented Apr 22, 2024

Theoretically, tests should be run using python -m devscripts.run_tests; as a workaround until the cleanup pr is merged, you can mimick its behavior using pytest -Werror.

We change the test to self.assertWarns() in the cleanup PR.

@samoht0
Copy link
Author

samoht0 commented Apr 23, 2024

We change the test to self.assertWarns() in the cleanup PR.

Perfect. Tests working again with that change. Issue can be closed when merged in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs/meta/cleanup related to docs, code cleanup, templates, devscripts etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants