Giter Club home page Giter Club logo

find_testlog's Introduction

Find TestLog

This is a utility developed in Rust & Tauri Framework, designed to assist in finding and opening log files in a complex directory structure. This tool can be extremely useful if you have a directory structure based on product numbers, year-weeks, and test environments. The application uses a configuration file to save and reuse settings, enhancing its usability.

gui

Features

  • Search for log files based on parameters like drive letter, folder location, product number, year-week, test environment, and serial number.
  • Automatically open the found log files (optional).
  • Store the last used parameters in a configuration file for future use. These stored parameters will be used for subsequent searches unless new ones are provided.
  • Retrieve the location of the configuration file.
  • Command-line arguments take precedence over the configuration file.
  • Load and save application configuration from a file.
  • Easy interaction through a command-line interface.

Commandline Usage <WARNING NO LONGER SUPPORT SINCE 2.4.0>

The application accepts several command-line arguments:

-p, --pn <pn>: Product Number (Example: 9999-1234-5678).
-s, --sn <sn>: Serial Number (Example: xx-xx-yyy-000).
-y, --year_week <year_week>: Year Week (Example: 2023-W51). Defaults to searching all year-week folders.
-t, --test_env <test_env>: Test environment. Default is PTF.
-d, --drive_letter <drive_letter>: Drive letter. Default is Q:.
-f, --folder_location <folder_location>: Folder location. Default is TestLogs.
-g, --get_config_location: If passed, Returns config location.

If the tool has been run at least once, and no arguments are provided for the subsequent run, it will utilize the parameters stored in the configuration file from the last run:

./target/release/find-testlog

Getting Started

To use this tool, you need to have Rust installed on your system. If you don't, visit rust-lang.org/tools/install to install Rust.

Once you have Rust installed, you can clone this repository and build the project:

git clone https://github.com/yourusername/find-testlog.git
cd find-testlog
npm run tauri init
npm run tauri build

Or You can download the latest version from the releases page.

Quickstart

Now you can run the utility (from the project root):

./target/release/find-testlog -d "D:" -f "TestLogs" -p "REPLACE_PRODUCT_NUMBER" -y "2023-W51" -t "PTF" -s "REPLACE_SERIAL_NUMBER"

output:
$ #1 D:\TestLogs\REPLACE_PRODUCT_NUMBER\2023-W51\PTF\20230515_105021_CLNTXXXX_group_0_REPLACE_SERIAL_NUMBER.log
$ #2 D:\TestLogs\REPLACE_PRODUCT_NUMBER\2023-W51\PTF\20240515_105021_CLNTXXXX_group_0_REPLACE_SERIAL_NUMBER.log
$ Please select #.. to open

Only passing the SN or PN will make the CLI tool search all folders.

./target/release/find-testlog -s "REPLACE_SERIAL_NUMBER"

output:
Matched log file paths:
$ #1 D:\TestLogs\REPLACE_PRODUCT_NUMBER\2023-W20\PTF\20230515_105021_CLNTXXXX_group_0_REPLACE_SERIAL_NUMBER - Copy.log
$ #2 D:\TestLogs\REPLACE_PRODUCT_NUMBER\2023-W20\PTF\20230515_105021_CLNTXXXX_group_0_REPLACE_SERIAL_NUMBER.log
$ #3 D:\TestLogs\REPLACE_PRODUCT_NUMBER\2023-W51\PTF\20230515_105021_CLNTXXXX_group_0_REPLACE_SERIAL_NUMBER.log
$ #4 D:\TestLogs\REPLACE_PRODUCT_NUMBER\2023-W51\PTF\20240515_105021_CLNTXXXX_group_0_REPLACE_SERIAL_NUMBER.log
$ Please select #.. to open

Overwrite configuration

If you wish to override some or all parameters stored in the configuration file, simply provide the new values as command-line arguments. For example:

./target/release/find-testlog -p "REPLACE_PRODUCT_NUMBER"

In this case, find-testlog will use the new product number but will pull all other parameters from the configuration file.

To see where your configuration file is located, run:

./target/release/find-testlog --get-config-location

Configuration file is located at: "C:\\Users\\User\\AppData\\Roaming\\find_testlog\\config\\default-config.toml"

The configuration file can be edited manually if needed. However, it is recommended to change parameters using the command-line arguments, as this ensures that the configuration file remains in a valid state.

Remember, the use of the configuration file can streamline your workflow, particularly when frequently searching for log files with the same parameters.

Dependencies

Contribution

This project is licensed under the GNU General Public License v3.0 License - see the LICENSE file for details.

Special thanks

find_testlog's People

Contributors

flixis avatar

Watchers

 avatar

find_testlog's Issues

search cannot differentiate between AET and PTF search when no date is given

When creating a search, the algorithm can search all folders if desired by not specifying the date.
However, by doing this the search will now return all testresults regardless of the "test_env" argument.

the desired results would only show the results from the selected "test_env".

The problem arrives with the current file structure:
..\<pn>\<date>\<testenv>\..

How fix?

Improve search

Search entire dir per PN for SN, unless -y is specified.

In production should result in only 1 or 2 log files.

Show latest 5 testlogs

Currently it only prints the latest testlog location and opens it

What I actually want is the latest 5 testlogs in a list in CLI

find_testlog <SN> <PN>

results
---------------
log1
...
log5
-------------

Type [number] to open logfile

CLI Automatic opening

Currently automatic opening is disabled, instead this should be changed to a selection type.
Where you can give a number from the list to then open the log file.

# 1 <path_to_file>
# 2 <path_to_file>
# 3 <path_to_file>
...

$ 3 

Opens log # 3

App crashes

  • Currently there is a chance that the app may kill itself on launch. (tmp fix 6cf9183)
  • App crashes when trying to find SN/PN that does not exist in large database.
  • Unhanded structures may result in crashing for GUI (fixed a2166f8 & 9cdf0fe) ->
    Q:\TestLogs\<PN>\2020-W18\FT\20200502.120141.<PN>.<SN>.FT.log
    Q:\TestLogs\6107-1605-0900\2020-W19\FI\20200504.082753.<PN>.<SN>.FI.log

Possible solutions:

  • Splitting search into its own thread to prevent this from happening

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.