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

Allow TCL 9.0 for tests #1673

Draft
wants to merge 4 commits into
base: unstable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion runtest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
TCL_VERSIONS="8.5 8.6 8.7"
TCL_VERSIONS="8.5 8.6 9.0"
TCLSH=""

for VERSION in $TCL_VERSIONS; do
Expand Down
2 changes: 1 addition & 1 deletion runtest-cluster
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
TCL_VERSIONS="8.5 8.6 8.7"
TCL_VERSIONS="8.5 8.6 9.0"
TCLSH=""

for VERSION in $TCL_VERSIONS; do
Expand Down
2 changes: 1 addition & 1 deletion runtest-moduleapi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
TCL_VERSIONS="8.5 8.6 8.7"
TCL_VERSIONS="8.5 8.6 9.0"
TCLSH=""
[ -z "$MAKE" ] && MAKE=make

Expand Down
2 changes: 1 addition & 1 deletion runtest-sentinel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
TCL_VERSIONS="8.5 8.6 8.7"
TCL_VERSIONS="8.5 8.6 9.0"
TCLSH=""

for VERSION in $TCL_VERSIONS; do
Expand Down
4 changes: 1 addition & 3 deletions tests/instances.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# This software is released under the BSD License. See the COPYING file for
# more information.

package require Tcl 8.5

set tcl_precision 17
source ../support/valkey.tcl
source ../support/util.tcl
Expand Down Expand Up @@ -294,7 +292,7 @@ proc parse_options {} {
incr j
set ::host ${val}
} elseif {$opt eq {--tls} || $opt eq {--tls-module}} {
package require tls 1.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not touch tls lib

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tls 1.6 requires TCL 8.x and it rejects TCL 9.x.

If we want to use TCL 9.0, we need to use tls 2.0, which is only a beta version now. It's not yet released.

If we want to allow different TCL versions, we also need different TLS lib versions, so I think we can remove the hard-coded version requirements.

package require tls
::tls::init \
-cafile "$::tlsdir/ca.crt" \
-certfile "$::tlsdir/client.crt" \
Expand Down
1 change: 0 additions & 1 deletion tests/support/cluster.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# $c get foo
# $c close

package require Tcl 8.5
package provide valkey_cluster 0.1

namespace eval valkey_cluster {}
Expand Down
2 changes: 0 additions & 2 deletions tests/support/response_transformers.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# changes in many files) we decided to transform the response to RESP2
# when running with --force-resp3

package require Tcl 8.5

namespace eval response_transformers {}

# Transform a map response into an array of tuples (tuple = array with 2 elements)
Expand Down
1 change: 0 additions & 1 deletion tests/support/valkey.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#
# vwait forever

package require Tcl 8.5
package provide valkey 0.1

source [file join [file dirname [info script]] "response_transformers.tcl"]
Expand Down
8 changes: 3 additions & 5 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# This software is released under the BSD License. See the COPYING file for
# more information.

package require Tcl 8.5

set tcl_precision 17
source tests/support/valkey.tcl
source tests/support/aofmanifest.tcl
Expand Down Expand Up @@ -344,7 +342,7 @@ proc test_server_cron {} {
}

proc accept_test_clients {fd addr port} {
fconfigure $fd -encoding binary
fconfigure $fd -translation binary
fileevent $fd readable [list read_from_test_client $fd]
}

Expand Down Expand Up @@ -543,7 +541,7 @@ proc the_end {} {
# to read the command, execute, reply... all this in a loop.
proc test_client_main server_port {
set ::test_server_fd [socket localhost $server_port]
fconfigure $::test_server_fd -encoding binary
fconfigure $::test_server_fd -translation binary
send_data_packet $::test_server_fd ready [pid]
while 1 {
set bytes [gets $::test_server_fd]
Expand Down Expand Up @@ -675,7 +673,7 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
} elseif {$opt eq {--io-threads}} {
set ::io_threads 1
} elseif {$opt eq {--tls} || $opt eq {--tls-module}} {
package require tls 1.6
package require tls
set ::tls 1
::tls::init \
-cafile "$::tlsdir/ca.crt" \
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/other.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ start_server {tags {"other"}} {
} else {
set fd2 [socket [srv host] [srv port]]
}
fconfigure $fd2 -encoding binary -translation binary
fconfigure $fd2 -translation binary
if {!$::singledb} {
puts -nonewline $fd2 "SELECT 9\r\n"
flush $fd2
Expand Down
Loading