CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 08:37:40 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"4d5def81076cf1ff4746db5e87b8a3d0"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=EQmNKcL6Xjm3phkHe9e6E%2B7KUpRcIxtvwaiyGUFjhvJuEvxteHtWWQ77%2BJSxmWEY3sSKd1gQQJ7CdPYx2tstixkYpp42dU65GqCDYe9WaklTCVUG7hR99QDgUK19xfpJJgT9kIZqaNscNrRpM9rEE3u4DD3SaYw8LXQAQnSrbcYhL%2BXMRygKSXVFfcdV0iBOy%2FqdVPzpjVL8gFWC%2F3Qts0zKZMac8B2cNHXGasXm%2FKH7m%2FUYG22OtDGf5atJyRaOfp22Uj1l7F2ko5osEsRgDw%3D%3D--Ra7MpAHqD17o1%2BEc--PewF%2FDUKnsCitKBxnAu2WA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2078283317.1753605460; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 08:37:40 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 08:37:40 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9454:363053:C660D3:106EC26:6885E554
GitHub - file/file-tests: File-tests is test-suite for File tool. Previous home: https://fedorahosted.org/file-tests/
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 8
File-tests is test-suite for File tool. Previous home: https://fedorahosted.org/file-tests/
License
file/file-tests
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
============================================================================== ================== File-tests - File regressions detection =================== ============================================================================== Author: Jan Kaluza <jkaluza@redhat.com> 1) WHY IS IT USEFUL? ==================== It's not possible to check the regressions between File releases manually and unfortunatelly File can't work 100% and even a small change in one magic pattern can cause a big regression. This project aims to make comparing outputs of different File versions easier and provides database of files in different formats. 2) HOW TO USE IT? ================= This howto presumes that CWD is the root of the git repository (the same directory as this README file is in). 2.1: Prepare the Magdir: ------------------------ You have to provide the Magdir directory with magic patterns from the File sources of the exactly the same File version as you want to test. This is needed to identify particular magic pattern responsible for the particular file detection. You can just copy Magdir into the CWD: $ cp -pr /path/to/file/magic/Magdir ./ 2.2: Update the database with the current/old File version: ----------------------------------------------------------- Note that this whole procedure needs 3.5GB free space, because patterns are splitted and compiled by file individually. See HOW DOES IT WORK section for more details. $ python update-db.py <unique-name> [path_to_magdir] So in our case for example: $ python update-db.py file-5.07 Magdir 2.3: Install new File version you want to test regressions against: ------------------------------------------------------------------- $ sudo rpm -U my-file.prm my-file-libs.rpm ... 2.4: Run fast-regression-test: ------------------------------ Fast regression test tests the output of the currently installed File and compares it to the one stored in db/*/*.json files. If there's a significant difference (see HOW DOES IT WORK) between the output, it's showed as FAIL. $ python fast-regression-test.py If you run this test with "exact" argument, particular test will FAIL even if there's small change in the File output. 2.5: Identify patterns causing the regressions: ----------------------------------------------- With compare-db.py script, you can get the patterns causing the regression. At first you have to prepare the Magdir from the current File version as mentioned in step "2.1: Prepare the Magdir". Note that this whole procedure needs 3.5GB free space, because patterns are splitted and compiled by file individually. See HOW DOES IT WORK section for more details. $ python compare-db.py <unique-name> [path_to_magdir] So in our case for example: $ python compare-db.py file-5.10 Magdir If you run this test with "exact" argument, particular test will FAIL even if there's small change in the File output: $ python compare-db.py file-5.10 Magdir exact or $ python compare-db.py file-5.10 exact 3) HOW DOES IT WORK? ==================== There is database of files in "db" directory. 3.1: update.db script: ---------------------- At first, this script splits all the patterns from Magdir directory into separated files, so there is one magic pattern per file. Those files are stored into ./.mgc_temp/<file_name_hash>/output. After that, patterns are compiled using this algorithm: N = 0 pattern_to_compile = "" for every pattern: pattern_to_compile += pattern compile pattern_to_compile save it as ./.mgc_temp/<file_name_hash>/.find-magic.tmp.N N++ Then all files in the db directory are detected. During the detection, particular pattern responsible for detection is found using the bisection method. All metadata are stored into ./db/*/*.json file. 3.2: fast-regression-test.py script: ------------------------------------ This script simply gets metadata stored in the ./db/*/*.json files and compares them with the output of the current File version. In non-exact mode, regressions are detected using the Ratcliff/Obershelp pattern recognition implemented by difflib.SequenceMatcher Python module. The regression is detected if the ratio returned by the SequenceMatcher is lower than 0.7. In exact mode, the old and new output have to match exactly. 3.3: compare-db.py script: -------------------------- This script does the same work as update.db script, but instead of storing metadata into ./db directory, it compares them with the metadata already stored in ./db directory by previously run update-db.py script. Comparison is done the same way as in fast-regression-test.py script.
About
File-tests is test-suite for File tool. Previous home: https://fedorahosted.org/file-tests/
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
You can’t perform that action at this time.