-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add dummy test for linux * feat: add multiple test execution * fix: update exec of multiple scripts for linux * fix: execute tests with code from the branch * fix: fail test exec if at least one test fail * fix: typo * wip: test if symlink work * feat: add new test for check setup of light256 theme * feat: when theme enabled and not set it default to dark256 * feat: increase tests coverage of checking themes activation * refactor: rename tests_linux job * chore: add changelog entry
- Loading branch information
Showing
12 changed files
with
436 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: dev-push-check | ||
run-name: ${{ github.actor }} pushed new code 💻 | ||
on: [push] #, pull_request] | ||
jobs: | ||
lint_shellcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install shellcheck | ||
run: sudo apt-get install -y shellcheck | ||
- name: Checkout repo | ||
uses: actions/checkout@main | ||
- name: Lint files against shellcheck | ||
run: make lint_shellcheck | ||
lint_shfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install shfmt | ||
run: sudo apt-get install -y shfmt | ||
- name: Checkout repository | ||
uses: actions/checkout@main | ||
- name: Lint files against shfmt | ||
run: make lint_shfmt | ||
tests_linux: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint_shfmt | ||
- lint_shellcheck | ||
steps: | ||
- name: Install required software | ||
run: sudo apt install -y tmux git | ||
- name: Checkout repository | ||
uses: actions/checkout@main | ||
- name: Execute all linux tests and check results | ||
run: ./tests/run_all_linux_tests.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Linux tests | ||
|
||
Those tests are meant to run on linux: | ||
|
||
- ubuntu 20.04 LTS | ||
- with bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck disable=SC1091 | ||
source "${CURRENT_DIR}/../tmux_helpers.sh" | ||
|
||
main() { | ||
helper_tearup_linux | ||
|
||
cat <<EOF >~/.tmux.conf | ||
# List of plugins | ||
set -g @plugin 'tmux-plugins/tpm' | ||
set -g @plugin 'tmux-plugins/tmux-sensible' | ||
# Other plugins | ||
set -g @plugin 'egel/tmux-gruvbox' | ||
set -g @tmux-gruvbox 'dark256' | ||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) | ||
run '~/.tmux/plugins/tpm/tpm' | ||
EOF | ||
|
||
cat ~/.tmux.conf | ||
|
||
# it's essential to link current repo to the plugins' directory | ||
ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox" | ||
|
||
helper_install_tpm_plugins | ||
|
||
# start new detached session | ||
tmux new -d | ||
|
||
# check if left side match | ||
_status_left_expected="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]" | ||
_status_left_current=$(tmux show-option -gqv status-left) | ||
if [[ "$_status_left_current" != "$_status_left_expected" ]]; then | ||
helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
# check if status is not transparent | ||
_status_style_expected="bg=colour237,fg=colour223" | ||
_status_style_current=$(tmux show-option -gqv status-style) | ||
if [[ "$_status_style_current" != "$_status_style_expected" ]]; then | ||
helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
|
||
helper_print_success "status-left match" | ||
helper_teardown | ||
exit 0 | ||
|
||
} | ||
|
||
main "$@" |
57 changes: 57 additions & 0 deletions
57
tests/linux/test_check_gruvbox_dark_transparent_enabled.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck disable=SC1091 | ||
source "${CURRENT_DIR}/../tmux_helpers.sh" | ||
|
||
main() { | ||
helper_tearup_linux | ||
|
||
cat <<EOF >~/.tmux.conf | ||
# List of plugins | ||
set -g @plugin 'tmux-plugins/tpm' | ||
set -g @plugin 'tmux-plugins/tmux-sensible' | ||
# Other plugins | ||
set -g @plugin 'egel/tmux-gruvbox' | ||
set -g @tmux-gruvbox 'dark-transparent' | ||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) | ||
run '~/.tmux/plugins/tpm/tpm' | ||
EOF | ||
|
||
cat ~/.tmux.conf | ||
|
||
# it's essential to link current repo to the plugins' directory | ||
ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox" | ||
|
||
helper_install_tpm_plugins | ||
|
||
# start new detached session | ||
tmux new -d | ||
|
||
# check if left side match | ||
_status_left_expected="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]" | ||
_status_left_current=$(tmux show-option -gqv status-left) | ||
if [[ "$_status_left_current" != "$_status_left_expected" ]]; then | ||
helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
# check if status is not transparent | ||
_status_style_expected="bg=default,fg=colour223" | ||
_status_style_current=$(tmux show-option -gqv status-style) | ||
if [[ "$_status_style_current" != "$_status_style_expected" ]]; then | ||
helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
|
||
helper_print_success "status-left match" | ||
helper_teardown | ||
exit 0 | ||
|
||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck disable=SC1091 | ||
source "${CURRENT_DIR}/../tmux_helpers.sh" | ||
|
||
main() { | ||
helper_tearup_linux | ||
|
||
cat <<EOF >~/.tmux.conf | ||
# List of plugins | ||
set -g @plugin 'tmux-plugins/tpm' | ||
set -g @plugin 'tmux-plugins/tmux-sensible' | ||
# Other plugins | ||
set -g @plugin 'egel/tmux-gruvbox' | ||
set -g @tmux-gruvbox 'light256' | ||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) | ||
run '~/.tmux/plugins/tpm/tpm' | ||
EOF | ||
|
||
cat ~/.tmux.conf | ||
|
||
# it's essential to link current repo to the plugins' directory | ||
ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox" | ||
|
||
helper_install_tpm_plugins | ||
|
||
# start new detached session | ||
tmux new -d | ||
|
||
# check if left side match | ||
_status_left_expected="#[bg=colour243,fg=colour255] #S #[bg=colour252,fg=colour243,nobold,noitalics,nounderscore]" | ||
_status_left_current=$(tmux show-option -gqv status-left) | ||
if [[ "$_status_left_current" != "$_status_left_expected" ]]; then | ||
helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
# check if status is not transparent | ||
_status_style_expected="bg=colour252,fg=colour239" | ||
_status_style_current=$(tmux show-option -gqv status-style) | ||
if [[ "$_status_style_current" != "$_status_style_expected" ]]; then | ||
helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
|
||
helper_print_success "status-left match" | ||
helper_teardown | ||
exit 0 | ||
|
||
} | ||
|
||
main "$@" |
57 changes: 57 additions & 0 deletions
57
tests/linux/test_check_gruvbox_light_transparent_enabled.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck disable=SC1091 | ||
source "${CURRENT_DIR}/../tmux_helpers.sh" | ||
|
||
main() { | ||
helper_tearup_linux | ||
|
||
cat <<EOF >~/.tmux.conf | ||
# List of plugins | ||
set -g @plugin 'tmux-plugins/tpm' | ||
set -g @plugin 'tmux-plugins/tmux-sensible' | ||
# Other plugins | ||
set -g @plugin 'egel/tmux-gruvbox' | ||
set -g @tmux-gruvbox 'light-transparent' | ||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) | ||
run '~/.tmux/plugins/tpm/tpm' | ||
EOF | ||
|
||
cat ~/.tmux.conf | ||
|
||
# it's essential to link current repo to the plugins' directory | ||
ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox" | ||
|
||
helper_install_tpm_plugins | ||
|
||
# start new detached session | ||
tmux new -d | ||
|
||
# check if left side match | ||
_status_left_expected="#[bg=colour243,fg=colour255] #S #[bg=colour252,fg=colour243,nobold,noitalics,nounderscore]" | ||
_status_left_current=$(tmux show-option -gqv status-left) | ||
if [[ "$_status_left_current" != "$_status_left_expected" ]]; then | ||
helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
# check if status is not transparent | ||
_status_style_expected="bg=default,fg=colour239" | ||
_status_style_current=$(tmux show-option -gqv status-style) | ||
if [[ "$_status_style_current" != "$_status_style_expected" ]]; then | ||
helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
|
||
helper_print_success "status-left match" | ||
helper_teardown | ||
exit 0 | ||
|
||
} | ||
|
||
main "$@" |
59 changes: 59 additions & 0 deletions
59
tests/linux/test_without_theme_fallback_to_gruvbox_dark256.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck disable=SC1091 | ||
source "${CURRENT_DIR}/../tmux_helpers.sh" | ||
|
||
#### | ||
# Test: when the theme is not defined in config it should fallback to 'dark256' | ||
# | ||
main() { | ||
helper_tearup_linux | ||
|
||
# set config without theme defined | ||
cat <<EOF >~/.tmux.conf | ||
# List of plugins | ||
set -g @plugin 'tmux-plugins/tpm' | ||
set -g @plugin 'tmux-plugins/tmux-sensible' | ||
# Other plugins | ||
set -g @plugin 'egel/tmux-gruvbox' | ||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) | ||
run '~/.tmux/plugins/tpm/tpm' | ||
EOF | ||
|
||
cat ~/.tmux.conf | ||
|
||
# it's essential to link current repo to the plugins' directory | ||
ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox" | ||
|
||
helper_install_tpm_plugins | ||
|
||
# start new detached session | ||
tmux new -d | ||
|
||
# check if left side match | ||
_status_left_expected="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]" | ||
_status_left_current=$(tmux show-option -gqv status-left) | ||
if [[ "$_status_left_current" != "$_status_left_expected" ]]; then | ||
helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
# check if status is not transparent | ||
_status_style_expected="bg=colour237,fg=colour223" | ||
_status_style_current=$(tmux show-option -gqv status-style) | ||
if [[ "$_status_style_current" != "$_status_style_expected" ]]; then | ||
helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected" | ||
helper_teardown | ||
exit 1 | ||
fi | ||
|
||
helper_print_success "status-left match" | ||
helper_teardown | ||
exit 0 | ||
} | ||
|
||
main "$@" |
Oops, something went wrong.