Skip to content

Commit

Permalink
add e2e tests for general autotranslation (#7692)
Browse files Browse the repository at this point in the history
* add e2e tests for autotranslation

* add e2e tests for autotranslation

* add tests for kotlin autotranslation
  • Loading branch information
EfimovVladimir authored and LeeTZ committed Jul 17, 2018
1 parent cd4434b commit 601f461
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 8 deletions.
138 changes: 132 additions & 6 deletions test/ipynb/groovy/GeneralAutotranslationTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"And back to Groovy:"
"Groovy:"
]
},
{
Expand All @@ -60,14 +60,14 @@
"metadata": {},
"outputs": [],
"source": [
"beakerx.bar "
"beakerx.bar"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Or Python:"
"Translate to Python:"
]
},
{
Expand Down Expand Up @@ -97,7 +97,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Or Scala:"
"Translate to Scala:"
]
},
{
Expand All @@ -124,7 +124,96 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"And back to Groovy:"
"Groovy:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"beakerx.bar"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Translate to Clojure:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%clojure\n",
"(beakerx :get \"bar\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%clojure\n",
"(beakerx :set \"bar\" [345, \"clojure\", \"value\"])\n",
"(beakerx :get \"bar\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Groovy:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"beakerx.bar"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Translate to java:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%java\n",
"return NamespaceClient.getBeakerX().get(\"bar\");"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%java\n",
"Object[] arr = {new Integer(10), \"java\", \"value\"};\n",
"NamespaceClient.getBeakerX().set(\"bar\", arr);\n",
"return NamespaceClient.getBeakerX().get(\"bar\");"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Groovy:"
]
},
{
Expand All @@ -136,12 +225,49 @@
"beakerx.bar"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Translate to kotlin:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%kotlin\n",
"beakerx[\"bar\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%kotlin\n",
"beakerx[\"bar\"] = arrayOf(33, \"kotlin\", \"value\")\n",
"beakerx[\"bar\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Groovy:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"beakerx.bar"
]
}
],
"metadata": {
Expand Down
76 changes: 74 additions & 2 deletions test/js/groovy/generalAutotranslationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('General Autotranslation ', function () {
});
});

describe('%%python change beakerx.bar value', function(){
describe('%%python changes beakerx.bar value', function(){
it("Should display beakerx.bar value after python changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
Expand All @@ -88,7 +88,7 @@ describe('General Autotranslation ', function () {
});
});

describe('%%scala change beakerx.bar value', function(){
describe('%%scala changes beakerx.bar value', function(){
it("Should display beakerx.bar value after scala changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
Expand All @@ -104,4 +104,76 @@ describe('General Autotranslation ', function () {
});
});

describe('%%clojure ', function(){
it("Should display beakerx.bar value after scala changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /3.14, .*scala.*, .*value.*/);
});
});

describe('%%clojure changes beakerx.bar value', function(){
it("Should display beakerx.bar value after clojure changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /345, .*clojure.*, .*value.*/);
});
});

describe('Groovy kernel ', function(){
it("Should display beakerx.bar value after clojure changes", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /345, .*clojure.*, .*value.*/);
});
});

describe('%%java ', function(){
it("Should display beakerx.bar value after clojure changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /345, .*clojure.*, .*value.*/);
});
});

describe('%%java changes beakerx.bar value', function(){
it("Should display beakerx.bar value after java changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /10, .*java.*, .*value.*/);
});
});

describe('Groovy kernel ', function(){
it("Should display beakerx.bar value after java changes", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /10, .*java.*, .*value.*/);
});
});

describe('%%kotlin ', function(){
it("Should display beakerx.bar value after java changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /10, .*java.*, .*value.*/);
});
});

describe('%%kotlin changes beakerx.bar value', function(){
it("Should display beakerx.bar value after kotlin changes ", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /33, .*kotlin.*, .*value.*/);
});
});

describe('Groovy kernel ', function(){
it("Should display beakerx.bar value after kotlin changes", function(){
cellIndex += 1;
beakerxPO.runCodeCellByIndex(cellIndex);
beakerxPO.waitAndCheckOutputTextOfExecuteResult(cellIndex, /33, .*kotlin.*, .*value.*/);
});
});

});

0 comments on commit 601f461

Please sign in to comment.