nodejs/README.md
2025-01-08 12:49:33 +01:00

63 lines
1.4 KiB
Markdown

# Node.JS Tests
Nodejs test suite for Fedora Linux
These tests made for Test Management Tool, using .fmf format for metadata
[Tmt docs for reference](/https://tmt.readthedocs.io/en/stable/)
# Usage locally
Make sure you got tmt and its tools installed:
```bash
sudo dnf install -y tmt tmt+provision-virtual
```
or if you want all tools (virtual and container):
```bash
sudo dnf install -y tmt+all
```
## If not provided create koji build and set env variable
you can use the following allias to create build and set env automatically:
```bash
alias scratchbuild='function _scratchbuild() { \
SRC_RPM=$(ls *.src.rpm | head -n 1); \
if [ -z "$SRC_RPM" ]; then \
echo "No source RPM file found in the current directory."; \
return 1; \
fi; \
BUILD_OUTPUT=$(koji build --scratch rawhide $SRC_RPM 2>&1); \
KOJI_TASK_ID=$(echo "$BUILD_OUTPUT" | grep -oP "(?<=Task ID: )[0-9]+"); \
if [[ -n $KOJI_TASK_ID ]]; then \
export KOJI_TASK_ID=$KOJI_TASK_ID; \
echo "Scratch build completed. Task ID: $KOJI_TASK_ID"; \
else \
echo "Failed to extract Task ID."; \
return 1; \
fi; \
}; _scratchbuild'
```
check what test plans and sub plans are available:
```bash
tmt plans
```
check what individual tests are available:
```bash
tmt tests
```
## Run all available tests
```bash
tmt run
```
## Run chosen plan or individual test
```bash
tmt plans
tmt run plans -n <plan>
```
```bash
tmt tests
tmt run tests -n <test>
```