Skip to content

Commit

Permalink
alias version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
d-stefanovic committed Oct 16, 2023
1 parent d53d69e commit 53c3dbb
Show file tree
Hide file tree
Showing 15 changed files with 156 additions and 50 deletions.
8 changes: 4 additions & 4 deletions sem-version
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ version::change_elixir() {
[[ "$software_version" == "1.12" ]] && software_version="1.12.3"
[[ "$software_version" == "1.13" ]] && software_version="1.13.4"
[[ "$software_version" == "1.14" ]] && software_version="1.14.5"
[[ "$software_version" == "1.15" ]] && software_version="1.15.2"
[[ "$software_version" == "1.15" ]] && software_version="1.15.7"

if [[ $(kiex list) != *"${software_version}"* ]];then
sem-install elixir "${software_version}"
Expand Down Expand Up @@ -96,8 +96,8 @@ version::change_php() {
[[ "$software_version" == "7.2" ]] && software_version="7.2.34"
[[ "$software_version" == "7.3" ]] && software_version="7.3.33"
[[ "$software_version" == "7.4" ]] && software_version="7.4.33"
[[ "$software_version" == "8" ]] && software_version="8.0.29"
[[ "$software_version" == "8.0" ]] && software_version="8.0.29"
[[ "$software_version" == "8" ]] && software_version="8.0.30"
[[ "$software_version" == "8.0" ]] && software_version="8.0.30"

if ! [ -d ~/.phpbrew/php/php-"${software_version}" ]; then
sem-install php "${software_version}"
Expand Down Expand Up @@ -129,7 +129,7 @@ version::change_erlang() {
[[ "$software_version" == "23" ]] && software_version="23.3"
[[ "$software_version" == "24" ]] && software_version="24.3"
[[ "$software_version" == "25" ]] && software_version="25.3"
[[ "$software_version" == "26" ]] && software_version="26.0"
[[ "$software_version" == "26" ]] && software_version="26.1"

if [[ $(kerl list installations) != *"${software_version}"* ]]; then
sem-install erlang "${software_version}"
Expand Down
6 changes: 3 additions & 3 deletions tests/sem_version_bionic/elixir.bats
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ setup() {
assert_line --partial "Elixir 1.14.5"
}

@test "change elixir to 1.15.2" {
sem-version elixir 1.15.2
@test "change elixir to 1.15.7" {
sem-version elixir 1.15.7
run elixir --version
assert_line --partial "Elixir 1.15.2"
assert_line --partial "Elixir 1.15.7"
}
6 changes: 6 additions & 0 deletions tests/sem_version_bionic/erlang.bats
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ setup() {
run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
assert_line --partial "26"
}

@test "change erlang to 26.1" {
sem-version erlang 26.1
run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
assert_line --partial "26"
}
16 changes: 8 additions & 8 deletions tests/sem_version_bionic/php.bats
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,32 @@ setup() {
assert_line --partial "imap"
}

@test "change php to 8.0.29" {
@test "change php to 8.0.30" {

run sem-version php 8.0.29
run sem-version php 8.0.30
assert_success
source ~/.phpbrew/bashrc
run php -v
assert_line --partial "PHP 8.0.29"
assert_line --partial "PHP 8.0.30"
run php -m
assert_line --partial "gd"
assert_line --partial "imap"
}

@test "php check composer 8.0.29" {
@test "php check composer 8.0.30" {

run which composer
assert_success
source ~/.phpbrew/bashrc
assert_line --partial "8.0.29"
assert_line --partial "8.0.30"
}

@test "php check source 8.0.29" {
@test "php check source 8.0.30" {

run sem-version php 8.0.29
run sem-version php 8.0.30
assert_success
source ~/.phpbrew/bashrc
assert_line --partial "8.0.29"
assert_line --partial "8.0.30"
run phpbrew ext install iconv
assert_success
}
6 changes: 3 additions & 3 deletions tests/sem_version_focal/elixir.bats
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ setup() {
assert_line --partial "Elixir 1.14.5"
}

@test "change elixir to 1.15.2" {
sem-version elixir 1.15.2
@test "change elixir to 1.15.7" {
sem-version elixir 1.15.7
run elixir --version
assert_line --partial "Elixir 1.15.2"
assert_line --partial "Elixir 1.15.7"
}
6 changes: 3 additions & 3 deletions tests/sem_version_focal/node.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ setup() {
assert_line --partial "v16.15.1"
}

@test "change node to 18.16.1" {
sem-version node 18.16.1
@test "change node to 18.18.0" {
sem-version node 18.18.0
run node --version
assert_line --partial "v18.16.1"
assert_line --partial "v18.18.0"
}
24 changes: 12 additions & 12 deletions tests/sem_version_focal/php.bats
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,47 @@ setup() {
assert_line --partial "imap"
}

@test "change php to 8.0.29" {
@test "change php to 8.0.30" {

run sem-version php 8.0.29
run sem-version php 8.0.30
assert_success
source ~/.phpbrew/bashrc
run php -v
assert_line --partial "PHP 8.0.29"
assert_line --partial "PHP 8.0.30"
run php -m
assert_line --partial "gd"
assert_line --partial "imap"
}

@test "php check composer 8.0.29" {
@test "php check composer 8.0.30" {

run which composer
assert_success
source ~/.phpbrew/bashrc
assert_line --partial "8.0.29"
assert_line --partial "8.0.30"
}

@test "php check 8.0.29" {
@test "php check 8.0.30" {

run sem-version php 8.0.29
run sem-version php 8.0.30
assert_success
source ~/.phpbrew/bashrc
assert_line --partial "8.0.29"
assert_line --partial "8.0.30"
run phpbrew ext install iconv
assert_success
}

@test "php check sources 8.0.29" {
@test "php check sources 8.0.30" {

run sem-version php 8.0.29
run sem-version php 8.0.30
assert_success
source ~/.phpbrew/bashrc

run ls -lah ~/.phpbrew/distfiles/
assert_line --partial "8.0.29"
assert_line --partial "8.0.30"

run ls -lah ~/.phpbrew/build/
assert_line --partial "8.0.29"
assert_line --partial "8.0.30"

run phpbrew ext install iconv
assert_success
Expand Down
74 changes: 74 additions & 0 deletions tests/sem_version_focal/ruby.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env bats

load "../support/bats-support/load"
load "../support/bats-assert/load"

setup() {
source /tmp/.env-*
export PATH="/home/semaphore/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
set -u
source ~/.toolbox/toolbox
}

# Ruby
@test "change ruby to 2.7.8" {

run sem-version ruby 2.7.8
assert_success
run ruby --version
assert_line --partial "ruby 2.7.8"
}

@test "change ruby to 3.0.6" {

run sem-version ruby 3.0.6
assert_success
run ruby --version
assert_line --partial "ruby 3.0.6"
}

@test "change ruby to 3.1.4" {

run sem-version ruby 3.1.4
assert_success
run ruby --version
assert_line --partial "ruby 3.1.4"
}

@test "change ruby to 3.2.2" {

run sem-version ruby 3.2.2
assert_success
run ruby --version
assert_line --partial "ruby 3.2.2"
}

@test "ruby minor versions test" {

run sem-version ruby 2.7
assert_success
run ruby --version
assert_line --partial "ruby 2.7.8"

run sem-version ruby 3.0
assert_success
run ruby --version
assert_line --partial "ruby 3.0.6"

run sem-version ruby 3.1
assert_success
run ruby --version
assert_line --partial "ruby 3.1.4"

run sem-version ruby 3.2
assert_success
run ruby --version
assert_line --partial "ruby 3.2.2"
}

@test "change ruby to 4.0.1" {

run sem-version ruby 4.0.1
assert_failure
}
6 changes: 3 additions & 3 deletions tests/sem_version_jammy_arm/elixir.bats
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ setup() {
assert_line --partial "Elixir 1.15.0"
}

@test "change elixir to 1.15.2" {
sem-version elixir 1.15.2
@test "change elixir to 1.15.7" {
sem-version elixir 1.15.7
run elixir --version
assert_line --partial "Elixir 1.15.2"
assert_line --partial "Elixir 1.15.7"
}
6 changes: 6 additions & 0 deletions tests/sem_version_jammy_arm/erlang.bats
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ setup() {
run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
assert_line --partial "26"
}

@test "change erlang to 26.1" {
sem-version erlang 26.1
run erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
assert_line --partial "26"
}
9 changes: 9 additions & 0 deletions tests/sem_version_jammy_arm/go.bats
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,12 @@ setup() {
run go version
assert_line --partial "go1.20.4"
}

@test "sem-version go 1.21.1" {

sem-version go 1.21.1
run echo ${PATH}
assert_line --partial "$(go env GOPATH)/bin"
run go version
assert_line --partial "go1.21.1"
}
6 changes: 6 additions & 0 deletions tests/sem_version_jammy_arm/java.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ setup() {
source ~/.toolbox/toolbox
}

@test "change java to 11" {
sem-version java 11
run java --version
assert_line --partial "openjdk 11."
}

@test "change java to 17" {
sem-version java 17
run java --version
Expand Down
6 changes: 3 additions & 3 deletions tests/sem_version_jammy_arm/node.bats
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ setup() {
assert_line --partial "v18.14.2"
}

@test "change node to 18.16.1" {
sem-version node 18.16.1
@test "change node to 18.18.0" {
sem-version node 18.18.0
run node --version
assert_line --partial "v18.16.1"
assert_line --partial "v18.18.0"
}
16 changes: 8 additions & 8 deletions tests/sem_version_jammy_arm/php.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@ setup() {
assert_line --partial "imap"
}

@test "change php to 8.1.18" {
@test "change php to 8.1.23" {

run sem-version php 8.1.18
run sem-version php 8.1.23
assert_success
source ~/.phpbrew/bashrc
run php -v
assert_line --partial "PHP 8.1.18"
assert_line --partial "PHP 8.1.23"
run php -m
assert_line --partial "gd"
assert_line --partial "imap"
}

@test "php check composer 8.1.18" {
@test "php check composer 8.1.23" {

run which composer
assert_success
source ~/.phpbrew/bashrc
assert_line --partial "8.1.18"
assert_line --partial "8.1.23"
}

@test "php check source 8.1.18" {
@test "php check source 8.1.23" {

run sem-version php 8.1.18
run sem-version php 8.1.23
assert_success
source ~/.phpbrew/bashrc
assert_line --partial "8.1.18"
assert_line --partial "8.1.23"
run phpbrew ext install iconv
assert_success
}
11 changes: 8 additions & 3 deletions tests/sem_version_jammy_arm/ruby.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ setup() {
assert_line --partial "ruby 3.1.4"
}

@test "change ruby to 3.2.1" {
@test "change ruby to 3.2.2" {

run sem-version ruby 3.2.1
run sem-version ruby 3.2.2
assert_success
run ruby --version
assert_line --partial "ruby 3.2.1"
assert_line --partial "ruby 3.2.2"
}

@test "ruby minor versions test" {
Expand All @@ -60,6 +60,11 @@ setup() {
assert_success
run ruby --version
assert_line --partial "ruby 3.1.4"

run sem-version ruby 3.2
assert_success
run ruby --version
assert_line --partial "ruby 3.2.2"
}

@test "change ruby to 4.0.1" {
Expand Down

0 comments on commit 53c3dbb

Please sign in to comment.