Skip to content

Commit

Permalink
test: update polyglot test and targets
Browse files Browse the repository at this point in the history
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
  • Loading branch information
gabor-boros committed May 15, 2022
1 parent 894c8c6 commit a0da68b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Expand Up @@ -204,21 +204,18 @@ jobs:
run: |
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source $HOME/.nvm/nvm.sh
nvm install 5.12
nvm install 16.14
- name: polyglot tests for javascript
uses: ./.github/actions/driver-tests
with:
driver_name: javascript
driver_dist_dir: /tmp/driver/dist
repo_url: https://github.com/rethinkdb/rethinkdb-javascript.git
# TODO: This commit is pointing after driver extraction, hence it should be the baseline.
# When all tests are passing using this commit hash, update the hash to the latest and
# fix the newly raised issues.
commit_hash: c717cb9e2bdab77b55b7a31a5d780ba293c5fadf
interpreter: js5
commit_hash: 9e3aa0a229d2f5759a5215844317dae4e7d58d10
interpreter: js16
test_target: polyglot
env_activate: source $HOME/.nvm/nvm.sh && nvm use 5.12
env_activate: source $HOME/.nvm/nvm.sh && nvm use 16.14
install_command: npm install && npm run build

- name: compress test artifacts for upload
Expand Down Expand Up @@ -256,7 +253,7 @@ jobs:
driver_name: ruby
driver_dist_dir: /tmp/driver/lib
repo_url: https://github.com/rethinkdb/rethinkdb-ruby.git
commit_hash: 25781763f1af4e85116c80fd0cc988927e9c6829
commit_hash: 002f5476b760b696ed83213eba9f5d2e565ca488
interpreter: rb2.5
test_target: polyglot
env_activate: source /etc/profile.d/rvm.sh && rvm use 2.5
Expand Down
16 changes: 6 additions & 10 deletions test/rql_test/src/format.yaml
Expand Up @@ -5,8 +5,8 @@ tests:
rb: r.format("With great {noun} comes great responsibility.", {"noun" => "power"})
ot: "With great power comes great responsibility."
# Formatting at the beginning and end of the text
- cd: r.format("{with} great power comes great {what}", {"with": "With", "what": "responsibility"})
rb: r.format("{with} great power comes great {what}", {"with" => "With", "what" => "responsibility"})
- cd: r.format("{with} great power comes great {what}.", {"with": "With", "what": "responsibility"})
rb: r.format("{with} great power comes great {what}.", {"with" => "With", "what" => "responsibility"})
ot: "With great power comes great responsibility."
# Formatting with empty placeholder
- cd: r.format("With great {} comes great responsibility.", {"": "power"})
Expand All @@ -24,14 +24,10 @@ tests:
- cd: r.format("{bottles} bottles of beer on the wall.", {"bottles": 99.12345})
rb: r.format("{bottles} bottles of beer on the wall.", {"bottles" => 99.12345})
ot: "99.12345 bottles of beer on the wall."
# Using mixed values for formatting
- cd: r.format("x is not in {list}", {"list": ["one", 2, 3.45678, {"nine": 9}]})
rb: r.format("x is not in {list}", {"list" => ["one", 2, 3.45678, {"nine" => 9}]})
ot: "x is not in ["one",2,3.45678,{"nine":9}]"
# Placeholder not found in replacement parameters
- cd: r.format("foo {bar} baz", {})
rb: r.format("foo {bar} baz", {})
ot: err('ReqlNonExistenceError', 'No attribute `bar` in object'))
ot: err('ReqlNonExistenceError', 'No attribute `bar` in object:')
# Placeholder indicator curly braces is not closed
- cd: r.format("foo {bar baz", {"bar": "bar" })
rb: r.format("foo {bar baz", {"bar" => "bar" })
Expand All @@ -44,8 +40,8 @@ tests:
rb: r.format("foo {{nested}} baz", {"nested" => "bar" })
ot: err('ReqlQueryLogicError', 'Nested template parameters are not allowed')
- cd: r.format("{foo} {bar} {baz}", ["foo", "bar", "baz"])
ot: err('ReqlQueryLogicError', 'Expected type OBJECT but found ARRAY')
ot: err('ReqlQueryLogicError', 'Expected type OBJECT but found ARRAY.')
- cd: r.format("{foo} bar baz", "foo")
ot: err('ReqlQueryLogicError', 'Expected type OBJECT but found STRING')
ot: err('ReqlQueryLogicError', 'Expected type OBJECT but found STRING.')
- cd: r.format("{foo} bar baz", 1)
ot: err('ReqlQueryLogicError', 'Expected type OBJECT but found NUMBER')
ot: err('ReqlQueryLogicError', 'Expected type OBJECT but found NUMBER.')
3 changes: 1 addition & 2 deletions test/rql_test/test-runner
Expand Up @@ -548,12 +548,11 @@ class JrbLang(RbLang):
self.interpreter_name_exe_names.append('jruby')

interpreters = {
'js': [JsLang('5.12'), JsLang('16.14')],
'js': [JsLang('16.14')],
'py': [PyLang('2.7'), PyLang('3.6'), PyLang('3.8')],
'rb': [RbLang('2.5'), RbLang('2.6'), RbLang('2.7'), JrbLang('9.2')],
'jrb': [JrbLang('9.0')],

'js5': [JsLang('5.12')],
'js16': [JsLang('16.14')],

'py2': [PyLang('2.7')],
Expand Down

0 comments on commit a0da68b

Please sign in to comment.