The Ecstasy CLI #87
Replies: 4 comments 1 reply
-
|
My biggest concern with options 2) and 3) is that they are geared specifically toward "us" (developers of Ecstasy libraries and tools), rather than "them" - developers of xqiz.it-hosted web applications - our main and most important audience. I don't yet have a clear picture how would "they" use our testing tools, but it's quite clear that it wouldn't be neither of the things listed above, but would have to be some kind of adapter to a well-defined testing API driven by the hosting UI. As such, I would guess that approach 1) gives us a bit of an incentive to provide a crisp and useful API to be used by both us and them |
Beta Was this translation helpful? Give feedback.
-
|
Right, this is probably where there is some disconnect or misunderstanding then. Are you saying they "customers" who write Ecstasy applications in their IDE will only execute that code in the hosted xqiz.it service? That's a bit different to the developer workflow I am used to. |
Beta Was this translation helpful? Give feedback.
-
|
Yes; consider what you need to do as a "standalone" app developer to use a database. Take a look at WelcomeTest lines 16-22. You need to know the location of the database, provide a directory for the generated code artifacts and manually create the connection. However, If you are using our hosted environment (welcome), all you do is: If you're trying to create a WebApp manually, the additional complexity that comes for "no cost" in the hosted environment is even higher. In the range of "hard" to "unattainable" |
Beta Was this translation helpful? Give feedback.
-
|
Somewhere, buried in the gradle someplace, we're gonna need tests to test our own tools - as opposed to the XTC version of JUnit. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion is to work through some ideas and proposals for the Ecstasy command line tools. Each of these tools has its own set of command line options to control its behavior. The reason for starting this discussion is that we will need a way for developers to execute tests from the command line and there are a few options available.
Ecstasy currently has three command line tools:
xtc- to compile Ecstacy codexec- to execute compiled codexam- disassemble Ecstacy codeExecuting Tests
Tests are executed by the Unit engine module. When executing tests there are a number of options that the developer can supply to control how the tests execute.
Test Execution Options
The list below shows some options that could be used to control test execution. This list is by no means a definite set of option names, it is mainly as an example of the sort of options that could be required to give flexibility in executing tests.
Options to Control Which Tests are Executed
This is where we want to only run specific tests, for example only those related to the specific area of code we're currently working on.
--groupOnly run tests in a specific group. A test's group is specified in code as one of the properties of the
@Testmixin. For example:--group Slowonly run tests in theSlowgroup.--packageOnly run tests in a package name that matches a regex. This option could be repeated to run tests in multiple packages. For example:
--package myapp.webserverthis would only run tests in themyapp.webserverpackage.--classOnly run tests in a class name that matches a regex. This option could be repeated to run tests in multiple classes. For example:
--class myapp.webserver.CustomerTeststhis would only run tests in themyapp.webserver.CustomerTestsclass.--testOnly run tests where the method name matches a regex and would probably be combined with
--class. This option could be repeated to run tests in multiple tests .For example:--test shouldGetCustomersthis would only run theshouldGetCustomerstest.Options to Exclude Specific Tests from Execution
This is where we want to skip tests because they are temporarily broken or for some other reason.
--exclude-packageRun all tests but do not run tests in a package name that matches a regex. This option could be repeated to not run tests in multiple packages. For example:
--exclude-package myapp.webserverthis would not run tests in themyapp.webserverpackage.--exclude-classRun all tests but do not run tests in a class name that matches a regex. This is where we want to skip tests because they are temporarily broken or for some other reason. This option could be repeated to not run tests in multiple classes. For example:
--exclude-class myapp.webserver.CustomerTeststhis would not run tests in themyapp.webserver.CustomerTestsclass.--exclude-testOnly run tests where the method name matches a regex. This is where we only want to skip one or more individual tests in the whole suite. This option could be repeated to not run multiple tests .For example:
--exclude-test shouldGetCustomersthis would only run theshouldGetCustomerstest.Other Options
There are probably a few other options that could be added. For example:
--repeatRun the tests a number of times. This is useful when investigating intermittent failures where a test can be run a few hundred times. This would normally be combined with options like
-cor-tto run specific tests. For example:--repeat 100run the test 100 timesThere may also be options to control how tests are reported, whether to run tests in parallel, whether to stop execution at the first failure, etc.
Command Line Tool Choices
The choices for how we execute tests are:
xectool and add more options like those discussed above to control test executionxtestcommand line tool1. Use the
xecToolThe current
xectool is used to execute an Ecstasy programme from the command line. Executing tests is obviously a very similar process, instead of running a module'srun()method (or other method using the-moption) for executing tests we would run the XUnit test engine on the module.Advantages
The tool already exists and runs Ecstasy code.
Disadvantages
There are some options for
xecthat will not apply when running tests (e.g.-m) and there are a large number of options discussed above that only apply when running tests.2. Write a New
xtestToolA new
xtestcommand line tool could be written. This can re-use some of thexeccode and support all the new test options.Advantages
It gets around the problem of mixing normal execution options and test options in one executable
Disadvantages
We are introducing yet another command line tool.
3. Something Else...
The final option is to do something different. We could follow the example of other languages and CLI tools and just have a single command line tool. Instead of different tools we then have different sub-commands. For example, Go has a single tool called
gothat is run like this:go <command> [options]. Ecstasy could just have a singlextcexecutable that follows this same pattern.xtc buildxtc runxtc testetc...
Advantages
It gets around the problem of mixing normal execution options and test options
It is easier to extend than adding multiple additions command line tools
Disadvantages
Running a tool requires a bit more typing, e.g.
xtc runinstead ofxecBeta Was this translation helpful? Give feedback.
All reactions