.. _golang-plugin:
=============
Golang Plugin
=============
This optional plugin enables Avocado to list and run tests written using
the `Go programming language`_.
.. _Go programming language: https://golang.org/
To install the Golang plugin from pip, use::
$ sudo pip install avocado-framework-plugin-golang
If you're running Fedora, you can install the package ``golang-tests`` and run any of the tests
included there. You can try running the ``math`` or ``bufio`` tests like this::
$ GOPATH=/usr/lib/golang avocado list math
golang math:TestNaN
golang math:TestAcos
golang math:TestAcosh
golang math:TestAsin
... skip ...
And::
$ GOPATH=/usr/lib/golang avocado run math
JOB ID : 9453e09dc5a035e465de6abd570947909d6be228
JOB LOG : $HOME/avocado/job-results/job-2021-10-01T13.11-9453e09/job.log
(001/417) math:TestNaN: STARTED
(002/417) math:TestAcos: STARTED
(001/417) math:TestNaN: PASS (0.50 s)
(002/417) math:TestAcos: PASS (0.51 s)
(003/417) math:TestAcosh: STARTED
(004/417) math:TestAsin: STARTED
(003/417) math:TestAcosh: PASS (0.50 s)
(004/417) math:TestAsin: PASS (0.51 s)
(005/417) math:TestAsinh: STARTED
(006/417) math:TestAtan: STARTED
^C
RESULTS : PASS 4 | ERROR 0 | FAIL 0 | SKIP 413 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : $HOME/avocado/job-results/job-2021-10-01T13.11-9453e09/results.html
JOB TIME : 2.76 s
Another option is to try the countavocados examples provided with avocado.
Please fetch the avocado code where this example is included. ::
$ git clone https://github.com/avocado-framework/avocado.git
Also, disable the `Module-aware mode`_, this can be done with the GO111MODULE environment variable::
$ go env -w GO111MODULE=off
.. _Module-aware mode: https://golang.org/ref/mod#mod-commands
Then you can ``list`` and ``run`` the countavocados tests provided with the plugin::
$ GOPATH=$PWD/avocado/optional_plugins/golang/tests avocado -V list countavocados
Type Test Tag(s)
golang countavocados:TestEmptyContainers
golang countavocados:TestNoContainers
golang countavocados:ExampleContainers
Resolver Reference Info
avocado-instrumented countavocados File name "countavocados" does not end with suffix ".py"
exec-test countavocados File "countavocados" does not exist or is not a executable file
TEST TYPES SUMMARY
==================
golang: 3
And ::
$ GOPATH=$PWD/avocado/optional_plugins/golang/tests avocado run countavocados
JOB ID : c4284429a1ff97cd737b6e6fe1c5a83f91007317
JOB LOG : $HOME/avocado/job-results/job-2021-10-01T13.35-c428442/job.log
(1/3) countavocados:TestEmptyContainers: STARTED
(2/3) countavocados:TestNoContainers: STARTED
(1/3) countavocados:TestEmptyContainers: PASS (0.50 s)
(2/3) countavocados:TestNoContainers: PASS (0.50 s)
(3/3) countavocados:ExampleContainers: STARTED
(3/3) countavocados:ExampleContainers: PASS (0.50 s)
RESULTS : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : $HOME/avocado/job-results/job-2021-10-01T13.35-c428442/results.html
JOB TIME : 2.12 s
Raw data
{
"_id": null,
"home_page": "http://avocado-framework.github.io/",
"name": "avocado-framework-plugin-golang",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Avocado Developers",
"author_email": "avocado-devel@redhat.com",
"download_url": "https://files.pythonhosted.org/packages/cc/9e/36d64399619fc3fe4626cfed7d89951930e00b28f33053b8f183cc525461/avocado_framework_plugin_golang-109.0.tar.gz",
"platform": null,
"description": ".. _golang-plugin:\n\n=============\nGolang Plugin\n=============\n\nThis optional plugin enables Avocado to list and run tests written using\nthe `Go programming language`_.\n\n.. _Go programming language: https://golang.org/\n\nTo install the Golang plugin from pip, use::\n\n $ sudo pip install avocado-framework-plugin-golang\n\nIf you're running Fedora, you can install the package ``golang-tests`` and run any of the tests\nincluded there. You can try running the ``math`` or ``bufio`` tests like this::\n\n $ GOPATH=/usr/lib/golang avocado list math\n golang math:TestNaN\n golang math:TestAcos\n golang math:TestAcosh\n golang math:TestAsin\n ... skip ...\n\nAnd::\n\n $ GOPATH=/usr/lib/golang avocado run math\n JOB ID : 9453e09dc5a035e465de6abd570947909d6be228\n JOB LOG : $HOME/avocado/job-results/job-2021-10-01T13.11-9453e09/job.log\n (001/417) math:TestNaN: STARTED\n (002/417) math:TestAcos: STARTED\n (001/417) math:TestNaN: PASS (0.50 s)\n (002/417) math:TestAcos: PASS (0.51 s)\n (003/417) math:TestAcosh: STARTED\n (004/417) math:TestAsin: STARTED\n (003/417) math:TestAcosh: PASS (0.50 s)\n (004/417) math:TestAsin: PASS (0.51 s)\n (005/417) math:TestAsinh: STARTED\n (006/417) math:TestAtan: STARTED\n ^C\n RESULTS : PASS 4 | ERROR 0 | FAIL 0 | SKIP 413 | WARN 0 | INTERRUPT 0 | CANCEL 0\n JOB HTML : $HOME/avocado/job-results/job-2021-10-01T13.11-9453e09/results.html\n JOB TIME : 2.76 s\n\nAnother option is to try the countavocados examples provided with avocado.\nPlease fetch the avocado code where this example is included. ::\n\n $ git clone https://github.com/avocado-framework/avocado.git\n\nAlso, disable the `Module-aware mode`_, this can be done with the GO111MODULE environment variable::\n\n $ go env -w GO111MODULE=off\n\n.. _Module-aware mode: https://golang.org/ref/mod#mod-commands\n\nThen you can ``list`` and ``run`` the countavocados tests provided with the plugin::\n\n $ GOPATH=$PWD/avocado/optional_plugins/golang/tests avocado -V list countavocados\n Type Test Tag(s)\n golang countavocados:TestEmptyContainers\n golang countavocados:TestNoContainers\n golang countavocados:ExampleContainers\n\n Resolver Reference Info\n avocado-instrumented countavocados File name \"countavocados\" does not end with suffix \".py\"\n exec-test countavocados File \"countavocados\" does not exist or is not a executable file\n\n TEST TYPES SUMMARY\n ==================\n golang: 3\n\nAnd ::\n\n $ GOPATH=$PWD/avocado/optional_plugins/golang/tests avocado run countavocados\n JOB ID : c4284429a1ff97cd737b6e6fe1c5a83f91007317\n JOB LOG : $HOME/avocado/job-results/job-2021-10-01T13.35-c428442/job.log\n (1/3) countavocados:TestEmptyContainers: STARTED\n (2/3) countavocados:TestNoContainers: STARTED\n (1/3) countavocados:TestEmptyContainers: PASS (0.50 s)\n (2/3) countavocados:TestNoContainers: PASS (0.50 s)\n (3/3) countavocados:ExampleContainers: STARTED\n (3/3) countavocados:ExampleContainers: PASS (0.50 s)\n RESULTS : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0\n JOB HTML : $HOME/avocado/job-results/job-2021-10-01T13.35-c428442/results.html\n JOB TIME : 2.12 s\n",
"bugtrack_url": null,
"license": null,
"summary": "Avocado Plugin for Execution of Golang tests",
"version": "109.0",
"project_urls": {
"Homepage": "http://avocado-framework.github.io/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7c47b5d6a431b4eb720351cd1ef6d6738479ec63daeab3ab1ef83876eefae0a5",
"md5": "507c3be628ee0455bc771b98afbf11c2",
"sha256": "880726473993f665a3fa1ff402f212118224b9a955620a9e83b8e947ccdde997"
},
"downloads": -1,
"filename": "avocado_framework_plugin_golang-109.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "507c3be628ee0455bc771b98afbf11c2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5438,
"upload_time": "2025-01-14T13:27:21",
"upload_time_iso_8601": "2025-01-14T13:27:21.341911Z",
"url": "https://files.pythonhosted.org/packages/7c/47/b5d6a431b4eb720351cd1ef6d6738479ec63daeab3ab1ef83876eefae0a5/avocado_framework_plugin_golang-109.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc9e36d64399619fc3fe4626cfed7d89951930e00b28f33053b8f183cc525461",
"md5": "0b4a322997e9fec20dd0d66b77dba151",
"sha256": "f83e5c924411d0042617b4d171fb9069fbd9afd5d3338c043690feaf6ddf041b"
},
"downloads": -1,
"filename": "avocado_framework_plugin_golang-109.0.tar.gz",
"has_sig": false,
"md5_digest": "0b4a322997e9fec20dd0d66b77dba151",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5033,
"upload_time": "2025-01-14T13:27:44",
"upload_time_iso_8601": "2025-01-14T13:27:44.530116Z",
"url": "https://files.pythonhosted.org/packages/cc/9e/36d64399619fc3fe4626cfed7d89951930e00b28f33053b8f183cc525461/avocado_framework_plugin_golang-109.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 13:27:44",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "avocado-framework-plugin-golang"
}