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

Binbash #17

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
c3912d3
tests: move unit tests to tests/unit, add flag --unit to target them
uwla Nov 22, 2023
8ffad83
src: debug: Use a proper string concatenation
rodrigosiqueira Nov 7, 2023
5b1776e
src: debug: Add basic verbose code
rodrigosiqueira Nov 8, 2023
fb19daf
src: config: distinguish variable sources (global/local) in output
uwla Nov 24, 2023
9c37b48
src: checkpatch_wrapper: rename to codestyle
Andregnl Dec 2, 2023
d3b4f11
src: checkpatch_wrapper: Modernize codestyle
Andregnl Dec 2, 2023
4ab86a7
src: config.sh: remove duplicated config entries in config list
uwla Dec 1, 2023
96e243f
documentation: man: features: Add whatis entry
rodrigosiqueira Nov 25, 2023
6f24433
setup.sh: add flag --skip-docs to skip creation of man pages
uwla Dec 1, 2023
68f5923
src: lib: lore: Add pagination support to mailing lists
jppaulo06 Dec 2, 2023
bbb0553
setup.sh: fix --force flag interactive behavior in ArchLinux
uwla Dec 6, 2023
77d6333
src: lib: kw_config_loader: fix not reading line if missing newline char
uwla Dec 1, 2023
9ac7a08
setup.sh: add more short flags
uwla Dec 13, 2023
c32fe38
tests: integration: test kw version on ArchLinux, Debian and Fedora
uwla Dec 18, 2023
333df0e
tests: integration: add local config test
uwla Dec 4, 2023
98f1aab
tests: integration: add basic device test that checks distro
uwla Nov 28, 2023
ac3db7a
documentation: content: tests
uwla Dec 13, 2023
67d04a1
run_tests: allow running tests with the same basename
uwla Dec 19, 2023
a0f8eab
documentation: dependencies: add device-module related dependencies
uwla Dec 20, 2023
1ad9d7b
src: lib: lore: Change /tmp/ to /dev/shm dir
JGBSouza Nov 15, 2023
bdb99c9
tests: unit: lib: lore: Anonymize unit tests
davidbtadokoro Dec 5, 2023
a97d37f
src: lib: lore: Fix duplication when listing patchsets
davidbtadokoro Nov 24, 2023
d4c7dcc
src: ui: patch_hub: patchset_details_and_actions: Add bookmarking info
JGBSouza Dec 8, 2023
1764e42
src: deploy: fix preparation of remote directory
jooag Dec 11, 2023
07d895f
src: help.sh: show correct version on repo mode
dummyuser Dec 15, 2023
ff706fa
tests: unit: help: add tests for kw --version
uwla Jan 5, 2024
3bc9eb2
documentation: dependencies: Add libnotify dependency
MarceloSpessoto Jan 3, 2024
8482522
documentation: dependencies: fedora: Fix procps dependency in fedora
jppaulo06 Jan 11, 2024
57f23ab
src: config: Fix values with space separation in `kw config`
jppaulo06 Jan 10, 2024
d8239a1
documentation: content: tests: add instructions for rootless containers
uwla Jan 12, 2024
0a1d636
documentation: tutorials: pomodoro: Update old info
jppaulo06 Jan 15, 2024
a55f6e5
src: kw_remote: Add dashes to remote commands
jppaulo06 Jan 16, 2024
999f5d3
src: _kw: Fix Zsh completion of `kw pomodoro` `--description` option
davidbtadokoro Jan 17, 2024
1c7372c
src: lib: kwlib: Verbose mode for command substitution
aquilamacedo Jan 22, 2024
e71234d
src: lib: kw_db: Added verbose option to function select_from()
aquilamacedo Nov 21, 2023
8c0c1e7
src: lib: kw_db: Added verbose option to function insert_into()
aquilamacedo Nov 23, 2023
061f977
src: lib: kw_db: Added verbose option to function replace_into()
aquilamacedo Nov 23, 2023
9c9e902
src: lib: kw_db: Added verbose option to function remove_from()
aquilamacedo Nov 23, 2023
41cf7f9
src: lib: dialog_ui: Remove `LC_CTYPE` override for async loading scr…
davidbtadokoro Jan 30, 2024
5a46b16
tests: integration: Enhance text messages
jppaulo06 Jan 15, 2024
8e4902f
tests: integration: utils: Enhance code readability
jppaulo06 Jan 15, 2024
21d4400
tests: integration: Fix permission denied inside containers due to SE…
jppaulo06 Jan 15, 2024
2426864
src: build: Remove redundant override of `load_build_config`
davidbtadokoro Feb 7, 2024
addbe77
src: kw_remote: Avoid destroying symbolic links in the add operation
rodrigosiqueira Feb 10, 2024
603eaca
src: kw_remote: Avoid destroy link when use set-default
rodrigosiqueira Feb 10, 2024
825c4c4
src: kw_remote: Ensure that link survive after remote removal
rodrigosiqueira Feb 10, 2024
dbc0b27
src: kw_remote: Avoid destroy symbolic link when use rename
rodrigosiqueira Feb 10, 2024
fa63a6c
src: ui: patch_hub: patchset_details_and_actions: Fix returning from …
davidbtadokoro Jan 24, 2024
b58c3cd
src: lib: lore: Fix empty message ID bug in `get_patchset_bookmark_st…
davidbtadokoro Jan 24, 2024
2e35da0
src: lib: lore: Make query filter for Lore request more robust
davidbtadokoro Jan 24, 2024
aa867af
src: kw_remote: Fix typo in short help
davidbtadokoro Feb 13, 2024
974e5a3
src: kw_env: Improve env list output
rodrigosiqueira Feb 11, 2024
41c0dea
src: _kw: Revise `kw remote` Zsh completions
davidbtadokoro Feb 13, 2024
d1556d2
tests: integration: utils: fix container_exec for enhanced command ex…
aquilamacedo Feb 15, 2024
9e40555
kw: remove kw vars
MarceloSpessoto Feb 17, 2024
1dde3ce
tests: integration: device_test: exclude 'Distribution base' field
aquilamacedo Feb 27, 2024
2a63eb1
.github: workflows: integration_tests: integration tests workflow
aquilamacedo Feb 20, 2024
9b1ea6f
github: workflows: *.yml: update the checkout action version
sahil-sagwekar2652 Mar 28, 2024
9a8f319
documentation: man: features: kw-remote: Fix `-s` option
sahil-sagwekar2652 Apr 1, 2024
1ac2c61
src: report: fix the error messages for no data
sahil-sagwekar2652 Apr 2, 2024
358bafa
run_tests.sh: add command to clear test caches
uwla Apr 3, 2024
ce41fae
src: lib: lore: Obtain patch metadata more robustly
davidbtadokoro Mar 7, 2024
e639380
src: lib: lore: Overhaul processing of representative patches
davidbtadokoro Mar 7, 2024
9c4a5dd
src: lib: lore: Handle patch not yet processed when electing represen…
davidbtadokoro Feb 20, 2024
e342a3e
src: lib: lore: Parallelize `process_individual_patches`
davidbtadokoro Mar 7, 2024
1d6a52f
src: lib: lore: Parallelize `process_representative_patches`
davidbtadokoro Mar 4, 2024
a0c59f7
src: lib: lore: Revise display of patchset information
davidbtadokoro Jan 24, 2024
68a2b3a
src: remote: Improve ssh handling in case of failure
rodrigosiqueira Feb 1, 2024
15d40bd
src: lib: kw_db: Update database handling functions for WHERE clauses
JGBSouza Mar 21, 2024
3c11d23
src: lib: kw_db: Add update_into function
JGBSouza Apr 5, 2024
fbf7535
kw: fix unneeded variable redefinition
OJarrisonn Apr 18, 2024
efdcc76
kw: replace every "#!/bin/bash" shebang with "#!/usr/bin/env bash"
MarceloSpessoto Apr 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Integration tests
on:
[push, pull_request]

jobs:
initialize-repository:
runs-on: ubuntu-latest
defaults:
run:
shell: bash

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

integration-tests:
needs: initialize-repository
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Update the system
run: sudo apt update -y

- name: Install dependencies
run: |
sudo apt install -y shunit2 podman

- name: Integration tests
run: ./run_tests.sh --integration
4 changes: 2 additions & 2 deletions .github/workflows/kcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 3

Expand All @@ -37,7 +37,7 @@ jobs:
run: |
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
kcov_out/ ./run_tests.sh --unit

- name: Upload coverage do codecov
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck_reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
sh-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run the sh-checker
uses: luizm/[email protected]
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_setup_and_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# This is here just because git-email cannot be installed in the
# Github CI otherwise.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 3

Expand All @@ -30,4 +30,4 @@ jobs:

- name: Unit tests
run: |
./run_tests.sh
./run_tests.sh --unit
2 changes: 1 addition & 1 deletion database/migrate_legacy_data_20220101.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# This file handles the migration of legacy user data, from the old directories and files
# storage, to the new database model
Expand Down
1 change: 0 additions & 1 deletion documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@
('man/features/kw-pomodoro', 'kw-pomodoro', 'pomodoro style time management', [author], 1),
('man/features/kw-report', 'kw-report', 'user data report support', [author], 1),
('man/features/kw-ssh', 'kw-ssh', 'ssh access', [author], 1),
('man/features/kw-vars', 'kw-vars', 'view kw config values', [author], 1),
('man/features/kw-vm', 'kw-vm', 'commands to work with QEMU VMs', [author], 1),
('man/features/kw-self-update', 'kw-self-update', 'kw self-update mechanism', ['David Tadokoro, Everaldo Junior'], 1),
('man/features/kw-patch-hub', 'kw-patch-hub', 'UI with lore.kernel.org archives', ['David Tadokoro, Rodrigo Siqueira'], 1),
Expand Down
6 changes: 6 additions & 0 deletions documentation/content/codingstyle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ Good::

rsync --verbose --recursive dir1 dir2

Declaring shebangs
------------------

Avoid using "#!/bin/bash" when writing new bash files. This usual shebang may not work for
some linux distributions that don't follow FHS, such as NixOS. Use "#!/usr/bin/env bash" instead.

Conclusion
----------

Expand Down
46 changes: 44 additions & 2 deletions documentation/content/tests.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===============
About Tests
About Tests
===============

.. _tests:
Expand All @@ -9,6 +9,12 @@ Kw's tests rely on `shunit2`. The `run_tests.sh` script automatically detects
can have shunit2 source code in `tests/` (you can clone it from
https://github.com/kward/shunit2).

In order to run the integration tests, it is necessary to install Podman and to
configure it to run in rootless mode as explained in the official documentation:
https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md.
Podman is available via the default package manager of popular distros, such as
Arch, Debian, Fedora and those based on them.

If you want to run all the tests, try::

./run_tests.sh
Expand All @@ -19,7 +25,43 @@ List all available test files::

Or run individual tests with::

./run_tests.sh test TESTFILE1 ...
./run_tests.sh test TEST_FILE_1 ...

To limit the scope of the tests, pass the flag `--unit` or `--integration` as
the first argument to any of the examples above. So, the syntax is::

./run_tests.sh [scope] [command] [args]

Where `[scope]` can be `--unit` or `--integration`. The placeholder `[command]`
can be either `list`, `test` or simply omitted in order to run all tests. Here
are some examples:

.. code-block:: bash

./run_tests.sh --unit # run all unit tests
./run_tests.sh --unit list # list all unit tests
./run_tests.sh --unit test device # test device unit test
./run_tests.sh --unit clear-cache # clear unit tests cache
./run_tests.sh --integration # run all integration tests
./run_tests.sh --integration list # list all integration tests
./run_tests.sh --integration test device # test device integration test
./run_tests.sh --integration clear-cache # clear integration tests cache
./run_tests.sh # run all tests
./run_tests.sh list # list all tests
./run_tests.sh test device # run all device tests
./run_tests.sh clear-cache # clear all cache

The integration tests can take over 10 minutes to run in the first time because
podman is building the container images to be used in the tests, which requires
installing kw's dependencies in the supported distros. After the images have
been built and cached, running the integration tests should take only a few
seconds each time.

Then, the local kw repo is copied to the containers and installed again, which
takes very few seconds. For optimization purposes, the containers are reused
across tests. If you add a new commit or checkout to another branch, such that
HEAD points to another commit, the containers will be destroyed and created
again in order to install the current local version of kw.

Kw is already prepared to run tests, build the documentation and check the
installation in the github workflow.
3 changes: 3 additions & 0 deletions documentation/dependencies/arch.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ curl
perl-xml-xpath
coreutils
b4
procps-ng
pciutils
libnotify
3 changes: 3 additions & 0 deletions documentation/dependencies/debian.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ curl
libxml-xpath-perl
coreutils
b4
procps
pciutils
libnotify-bin
3 changes: 3 additions & 0 deletions documentation/dependencies/fedora.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ curl
perl-XML-XPath
coreutils
b4
procps-ng
pciutils
libnotify
8 changes: 4 additions & 4 deletions documentation/man/features/kw-backup.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========
kw-backup
=========
=============================================
kw-backup - Save and restore kw internal data
=============================================

.. _backup-doc:

Expand Down Expand Up @@ -45,4 +45,4 @@ save it into /documents/backup, then run::
To restore a backup, use the `\--restore` option. Suppose you want to restore the
backup stored in /documents/backup/kw-backup-from-yesterday.tar.gz, run::

kw backup --restore /documents/backup/kw-backup-from-yesterday.tar.gz
kw backup --restore /documents/backup/kw-backup-from-yesterday.tar.gz
8 changes: 4 additions & 4 deletions documentation/man/features/kw-build.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========
kw-build
========
=======================
kw-build - Build kernel
=======================

.. _build-doc:

Expand Down Expand Up @@ -157,4 +157,4 @@ If you want to reset the kernel tree to its default, `all config and script outp

If you want to use cflags::

kw b --cflags "-O3 -pipe -march=native"
kw b --cflags "-O3 -pipe -march=native"
13 changes: 9 additions & 4 deletions documentation/man/features/kw-codestyle.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
============
kw-codestyle
============
=================================
kw-codestyle - Checkpatch wrapper
=================================

.. _codestyle-doc:

SYNOPSIS
========
*kw* (*c* | *codestyle*) [<directory> | <file> | <patch>]
| *kw* (*c* | *codestyle*)
| *kw* (*c* | *codestyle*) [<directory> | <file> | <patch>]
| *kw* (*c* | *codestyle*) [\--verbose] [<directory> | <file> | <patch>]

DESCRIPTION
===========
Expand All @@ -22,6 +24,9 @@ OPTIONS
Define which files to run checkpatch on. Defaults to current working
directory if it is a kernel tree.

\--verbose:
Display commands executed under the hood.

EXAMPLES
========
For these examples, we suppose the fields in your **kworkflow.config** file are
Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-config.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========
kw-config
=========
=========================================
kw-config - Manage kw configuration files
=========================================

.. _config-doc:

Expand Down
12 changes: 9 additions & 3 deletions documentation/man/features/kw-debug.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========
kw-debug
========
=======================
kw-debug - Kernel debug
=======================

.. _debug-doc:

Expand All @@ -12,6 +12,7 @@ SYNOPSIS
| *kw* *debug* [(-l | \--list)[=(<ftrace> | <events>)]] [(-e | \--event)]
| *kw* *debug* [\--reset]
| *kw* *debug* [(-h | \--help)]
| *kw* *debug* [(\--verbose)]

DESCRIPTION
===========
Expand Down Expand Up @@ -123,6 +124,11 @@ OPTIONS
`\--dmesg`, kw will (1) clean the dmesg log, (2) run the command, (3) and
collect the log.

\--verbose:
Verbose mode is an option that causes the kw program to display debug
messages to track its steps. This functionality is very useful during the
debugging process, allowing you to identify possible errors more easily.

EXAMPLES
========

Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-deploy.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========
kw-deploy
=========
=========================
kw-deploy - Deploy kernel
=========================

.. _deploy-doc:

Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-device.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========
kw-device
=========
=========================================
kw-device - Retrieve hardware information
=========================================

.. _device-doc:

Expand Down
8 changes: 4 additions & 4 deletions documentation/man/features/kw-diff.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=======
kw-diff
=======
===================
kw-diff - Diff tool
===================

.. _diff-doc:

Expand All @@ -22,4 +22,4 @@ OPTIONS
\--verbose:
Verbose mode is an option that causes the kw program to display debug messages to track
its progress. This functionality is very useful during the debugging process, allowing
you to identify possible errors more easily.
you to identify possible errors more easily.
6 changes: 3 additions & 3 deletions documentation/man/features/kw-drm.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
======
kw-drm
======
============================
kw-drm - DRM subsystem tools
============================

.. _drm-doc:

Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-env.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
======
kw-env
======
===============================
kw-env - kw environment manager
===============================

.. _env-doc:

Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-explore.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==========
kw-explore
==========
===========================
kw-explore - Explore folder
===========================

.. _explore-doc:

Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-init.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=======
kw-init
=======
======================================
kw-init - Create kw basic config files
======================================

.. _init-doc:

Expand Down
6 changes: 3 additions & 3 deletions documentation/man/features/kw-kernel-config-manager.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========================
kw-kernel-config-manager
========================
=====================================================
kw-kernel-config-manager - Kernel config file manager
=====================================================

.. _kernel-config-manager-doc:

Expand Down
Loading
Loading