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

Testing tool missing from 7.6.0 release #10257

Open
TheDarkFlame opened this issue Mar 4, 2024 · 0 comments
Open

Testing tool missing from 7.6.0 release #10257

TheDarkFlame opened this issue Mar 4, 2024 · 0 comments

Comments

@TheDarkFlame
Copy link

TheDarkFlame commented Mar 4, 2024

Describe the bug
It appears that the source code suggests the presence of the new testing tool on V7.6.0, however this seems absent in the docker build.

To Reproduce

  1. Inspect the code for 7.6.0 run-ksql-test which shows the script existing
  2. Open a bash terminal in the ksqldb docker container with docker run -it confluentinc/cp-ksqldb-server:7.6.0
  3. Attempt to find the script using whereis run-ksql-test. The script cannot be found. ksql-test-runner does exist, (and sql-test-runner does not)
  4. Attempting to manually run the bash script in the github source code by pasting in the relevant lines:
ksql-run-class io.confluent.ksql.tools.test.SqlTestingTool "-h"

NAME
        sql-test-runner - The KSQL SQL testing tool

SYNOPSIS
        sql-test-runner {--temp-folder | -tf} <tempFolder>
                {--test-directory | -td} <testDirectory>

OPTIONS
        --temp-folder <tempFolder>, -tf <tempFolder>
            A folder to store temporary files

            This option may occur a maximum of 1 times


        --test-directory <testDirectory>, -td <testDirectory>
            A directory containing SQL files to test.

            This option may occur a maximum of 1 times

NB: observations:

  1. Add in the sample test and some dirs from the documentation
mkdir /tmp/input
mkdir /tmp/tempfile
echo "--@test: Passing test" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "CREATE STREAM s (id INT KEY, foo INT) WITH (kafka_topic='s', value_format='JSON');" >>/tmp/input/test.sql
echo "CREATE TABLE t (id INT PRIMARY KEY, bar INT) WITH (kafka_topic='t', value_format='JSON');" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "CREATE STREAM j AS SELECT s.id, s.foo, t.bar FROM s JOIN t ON s.id = t.id;" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "INSERT INTO t (rowtime, id, bar) VALUES (1, 1, 1);" >>/tmp/input/test.sql
echo "INSERT INTO s (rowtime, id, foo) VALUES (1, 1, 2);" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "ASSERT VALUES j (rowtime, s_id, foo, bar) VALUES (1, 1, 2, 1);" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "--@test: Failing test" >>/tmp/input/test.sql
echo "[email protected]: io.confluent.ksql.util.KsqlException" >>/tmp/input/test.sql
echo "[email protected]: (The following columns are changed, missing or reordered: [\`COL2\` INTEGER])" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "SET 'ksql.create.or.replace.enabled' = 'true';" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "CREATE STREAM a (id INT KEY, col1 INT, col2 INT) WITH (kafka_topic='a', value_format='JSON');" >>/tmp/input/test.sql
echo "CREATE STREAM b AS SELECT id, col1, col2 FROM a;" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "INSERT INTO a (id, col1) VALUES (3, 5);" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "ASSERT VALUES b (id, col1) VALUES (3, 5);" >>/tmp/input/test.sql
echo "" >>/tmp/input/test.sql
echo "CREATE OR REPLACE STREAM b AS SELECT id, col1 FROM a;" >>/tmp/input/test.sql
  1. run testing script with params
ksql-run-class io.confluent.ksql.tools.test.SqlTestingTool "-tf /tmp/input -td /tmp/output"

Found unexpected parameters: [-tf /tmp/input -td /tmp/output]
See the -h or --help flags for usage information

Based on the source code, this should definitely work. I tried it also supplying the full parameter names, and still have the same result.

Expected Behaviour

  1. The testing tool exists in the V7.6.0 image
  2. The testing class works with the variables it is requesting based on the help page.

Other Questions

  • Is there something fishy going on with the Jenkins build that excludes the new testing stuff?
  • Is there going to be a 0.30.0 as is indicated on the testing wiki page or is the naming convention changing to match the rest of confluent products? If so, the wiki page should be updated to match this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant