Skip to content

Commit 531835f

Browse files
committed
Doc initial RF 4.0a1 release notes
1 parent 594ba01 commit 531835f

File tree

1 file changed

+363
-0
lines changed

1 file changed

+363
-0
lines changed

doc/releasenotes/rf-4.0a1.rst

Lines changed: 363 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,363 @@
1+
===========================
2+
Robot Framework 4.0 alpha 1
3+
===========================
4+
5+
.. default-role:: code
6+
7+
`Robot Framework`_ 4.0 is a new major release with lot of big new features
8+
such as the SKIP status. Robot Framework alpha 1 is its first preview release
9+
targeted especially for developers of external tools that are affected by
10+
the new status.
11+
12+
All issues targeted for Robot Framework 4.0 can be found
13+
from the `issue tracker milestone`_.
14+
15+
Questions and comments related to the release can be sent to the
16+
`robotframework-users`_ mailing list or to `Robot Framework Slack`_,
17+
and possible bugs submitted to the `issue tracker`_.
18+
19+
If you have pip_ installed, just run
20+
21+
::
22+
23+
pip install --pre --upgrade robotframework
24+
25+
to install the latest available release or use
26+
27+
::
28+
29+
pip install robotframework==4.0a1
30+
31+
to install exactly this version. Alternatively you can download the source
32+
distribution from PyPI_ and install it manually. For more details and other
33+
installation approaches, see the `installation instructions`_.
34+
35+
Robot Framework 4.0 alpha 1 was released on Monday October 19, 2020.
36+
37+
.. _Robot Framework: http://robotframework.org
38+
.. _Robot Framework Foundation: http://robotframework.org/foundation
39+
.. _pip: http://pip-installer.org
40+
.. _PyPI: https://pypi.python.org/pypi/robotframework
41+
.. _issue tracker milestone: https://github.com/robotframework/robotframework/issues?q=milestone%3Av4.0
42+
.. _issue tracker: https://github.com/robotframework/robotframework/issues
43+
.. _robotframework-users: http://groups.google.com/group/robotframework-users
44+
.. _Robot Framework Slack: https://robotframework-slack-invite.herokuapp.com
45+
.. _installation instructions: ../../INSTALL.rst
46+
47+
.. contents::
48+
:depth: 2
49+
:local:
50+
51+
52+
Most important enhancements
53+
===========================
54+
55+
New SKIP status
56+
---------------
57+
58+
Robot Framework tests (and tasks) finally get the SKIP status (`#3622`_). There are
59+
many different ways for them to get it:
60+
61+
1. Tests can use new `Skip` and `Skip If` BuiltIn keywords. The former skips the test
62+
unconditionally and the latter accepts an expression that is evaluated using the
63+
same logic as with `Run Keyword If` and skips the test if the condition is true.
64+
Both also support an optional message telling why the test was skipped.
65+
66+
2. Libraries can raise an exception that tells that the test should be skipped. The
67+
easiest way is using the new `robot.api.SkipExecution` exception (also other special
68+
exceptions have been exposed similarly, see `#3685`_), but it is also possible to
69+
create a custom exception that has a special `ROBOT_SKIP_EXECUTION` attribute set
70+
to a true value.
71+
72+
3. If either of the above ways are used in suite setup, all tests in the that suite
73+
will be marked skipped without running them. If they are used in suite teardown,
74+
all tests are marked skipped retroactively.
75+
76+
4. New command line option `--skip` can be used to skip tests based on tags without
77+
running them. The difference compared to the old `--exclude` option is that skipped
78+
tests are shown in logs/reports as skipped while excluded tests are omitted
79+
altogether.
80+
81+
5. New command line option `--skiponfailure` can be used to mark tests that fail
82+
skipped. The idea is to allow having tests that are not ready, or that test
83+
a feature that is not ready, included in test runs without them failing the whole
84+
execution. This is in many ways similar to the old criticality concept that,
85+
as discussed in the next section, has been removed.
86+
87+
The SKIP status also affects the statuses of the executed suites. Their statuses are
88+
set based on test statuses using these rules:
89+
90+
- If there are failed tests, suite status is FAIL.
91+
- If there are no failures but there are passed tests, suite status is PASS.
92+
- If there are only skipped tests, or no tests at all, suite status is SKIP.
93+
94+
The return code to the system is the number of failed tests, skipped tests do not
95+
affect it.
96+
97+
Criticality has been removed
98+
----------------------------
99+
100+
Robot Framework has had a concept of criticality that made it possible to run tests so
101+
that their failures did not affect the overall test execution verdict. The motivation
102+
for this feature was acceptance test driven development (ATDD) where you create tests
103+
before implementing features and those tests naturally cannot pass initially. In
104+
addition to that, this functionality has been used for emulating skipping tests by
105+
dynamically marking them non-critical before failing. The system worked by using
106+
`--critical` and `--noncritical` options matching tests by tags.
107+
108+
Although this functionality worked ok in its designed usage, it also had several
109+
problems discussed in more detail below. Due to these problems the decision was made
110+
to remove the criticality concept (`#3624`_).
111+
112+
Problems with criticality
113+
~~~~~~~~~~~~~~~~~~~~~~~~~
114+
115+
1. Robot Framework 4.0 introduces real skip status (`#3622`_) which is conceptually very
116+
close to the criticality functionality. There are some differences, but these
117+
features are so close that having both does not add much benefits but instead causes
118+
confusion and adds unnecessary complexity.
119+
120+
2. Criticality makes the final outcome of a test two dimensional so that one axis is
121+
the actual status and the other is criticality. Even with only pass and fail statuses
122+
we end up with four different end results "critical pass", "critical fail",
123+
"non-critical pass" and "non-critical fail", and adding the skip status to the mix
124+
would add "critical skip" and "non-critical skip". Most of these final statuses make
125+
no sense and everything is a lot easier if there's only "pass", "fail" and "skip".
126+
127+
3. When looking at suite statistics in reports and logs, you can only see the total
128+
number of passed and failed tests without any indication are failures critical or not.
129+
We have experimented showing statistics separately both for critical and non-critical
130+
tests but that did not work well at all. This is similar problem as the one above
131+
and having just pass, fail and skip statuses resolves this one as well.
132+
133+
4. Related to the above, having statistics both for "Critical Tests" and "All Tests"
134+
in reports and logs is rather strange especially for new users. Just having single
135+
statistics with pass, fail and skip statuses is a lot simpler and intuitive.
136+
137+
5. Criticality is a unique feature in Robot Framework. Unique tool features can be
138+
really useful, but they also require learning by new (and old) users and they do not
139+
always play nicely together with other tools. In this particular case skip is
140+
a familiar feature for most people working with automation and it is also
141+
a functionality that external tools like test management systems generally support.
142+
143+
Migrating from criticality to skipping
144+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145+
146+
Part of the new skip functionality (`#3622`_) is adding `--skiponfailure` command line
147+
option that automatically changes status of tests having a matching tag to skip if they
148+
fail. This works very much like the current `--noncritical` option that marks tests
149+
non-critical and thus their failures are in practice ignored. To make migration to
150+
skipping easier, `--noncritical` and also `--critical` will be preserved as deprecated
151+
aliases to `--skiponfailure` when starting execution. They will also be preserved with
152+
Rebot, but with it they will have no effect.
153+
154+
Although `--noncritical` and `--critical` will continued to work mostly like earlier,
155+
there are various other changes affecting the current criticality users. Especially
156+
visible are changes in reports and logs where critical/non-critical distinction will
157+
be gone. Other changes include removing the `critical` attribute from `test` elements
158+
in output.xml and changes to the result related APIs.
159+
160+
Migrating to skipping very importantly requires changes to integration with external
161+
tools. This will certainly add some work to projects providing such integration
162+
(e.g. Robot Framework Jenkins Plugin), but in the end using commonly used skip status
163+
and not the unique criticality is likely to make things easier.
164+
165+
Libdoc enhancements
166+
-------------------
167+
168+
Libdoc generated HTML documentation has been enhanced so that it contains a navigation
169+
bar with easier access to keywords both directly and via search. Support for mobile
170+
browsers has also been improved. (`#3687`_)
171+
172+
List and dictionary expansion with item access
173+
----------------------------------------------
174+
175+
List and dictionary expansion using `@{list}` and `&{dict}` syntax, respectively,
176+
now works also in combination with item access like `@{var}[item]` (`#3487`_). This
177+
is how that syntax is handled:
178+
179+
- Both `@{var}[item]` and `&{var}[item]` first make a normal variable item lookup,
180+
exactly like when using `${var}[item]`. Nested access like `@{var}[item1][item2]`
181+
and using the slice notation with lists like `@{var}[1:]` are supported as well.
182+
- When using the `@{var}[item]` syntax, the found item must be a list or list-like.
183+
It is expanded exactly like `@{var}` is expanded normally.
184+
- When using the `&{var}[item]` syntax, the found item must be a mapping. It is
185+
expanded exactly like `&{var}` is expanded normally.
186+
187+
In practice the above means that if we have, for example, a variable `${var}` with
188+
value `{'items': ['a', 'b', 'c']}`, we could use it like this::
189+
190+
FOR ${item} IN @{var}[items]
191+
Log ${item}
192+
END
193+
194+
Prior to this change the item access needed to be done separately::
195+
196+
@{items} = Set Variable ${var}[items]
197+
FOR ${item} IN @{items}
198+
Log ${item}
199+
END
200+
201+
This change is backward incompatible because with earlier versions `@{var}[item]` and
202+
`&{var}[item]` meant normal item access with lists and dictionaries, respectively.
203+
The new generic `${var}[item]` access was introduced already in RF 3.1 (`#2601`__) and
204+
the old syntax was deprecated in RF 3.2 (`#2974`__).
205+
206+
__ https://github.com/robotframework/robotframework/issues/2601
207+
__ https://github.com/robotframework/robotframework/issues/2974
208+
209+
Positional-only arguments
210+
-------------------------
211+
212+
`Positional-only arguments`__ introduced in Python 3.8 are now supported (`#3695`_).
213+
They work for most parts already with earlier releases but now, for example, error
214+
reporting is better. Positional-only arguments are currently only supported with
215+
Python based keywords as well as with Java based keywords that have technically
216+
always been positional-only. There are no plans to support them with user keywords,
217+
but adding support to the dynamic API would probably be a good idea.
218+
219+
__ https://www.python.org/dev/peps/pep-0570/
220+
221+
222+
Backwards incompatible changes
223+
==============================
224+
225+
- As already discussed above, `criticality has been removed`_ (`#3624`_).
226+
- As also discussed above, the meaning of `@{var}[item]` and `&{var}[item]` syntax
227+
`has changed`__ (`#3487`_).
228+
- Python 3.4 is not anymore supported (`#3577`_).
229+
230+
__ `List and dictionary expansion with item access`_
231+
232+
233+
Acknowledgements
234+
================
235+
236+
Robot Framework development is sponsored by the `Robot Framework Foundation`_
237+
and its `40+ member organizations <https://robotframework.org/foundation/#members>`_.
238+
Due to some extra funding we have had a bit bigger team developing Robot Framework 4.0
239+
consisting of
240+
`Pekka Klärck <https://github.com/pekkaklarck>`_,
241+
`Janne Härkönen <https://github.com/yanne>`_,
242+
`Mikko Korpela <https://github.com/mkorpela>`_ and
243+
`René Rohner <https://github.com/Snooz82>`_.
244+
Pekka's work has been sponsored by the foundation, Janne and Mikko who work for
245+
`Reaktor <https://www.reaktor.com/>`__ have been sponsored by
246+
`Robocorp <https://robocorp.com/>`__, and René's work has been
247+
sponsored by his employer `imbus <https://www.imbus.de/en/>`__.
248+
249+
In addition to the work done by the dedicated team, we have got great
250+
contributions by the wider open source community:
251+
252+
- `Simandan Andrei-Cristian <https://github.com/cristii006>`__ implemented
253+
`Run Keyword And Warn On Failure` keyword. It is especially handy with suite
254+
teardowns if you do not want failures to fail all tests but do not want to hide
255+
the failure fully either. (`#2294`_)
256+
257+
- `Mihai Pârvu <https://github.com/mihaiparvu>`__ fixed problems using string 'none'
258+
(case-insensitively) with various keywords, most importantly with XML library
259+
keywords setting element text. (`#3649`_)
260+
261+
- `Hugo van Kemenade <https://github.com/hugovk>`__ did metadata and documentation
262+
changes to drop Python 3.4 support. (`#3577`_)
263+
264+
Huge thanks to all sponsors, contributors and to everyone else who has reported
265+
problems, participated in discussions on various forums, or otherwise helped to make
266+
Robot Framework and its community and ecosystem better.
267+
268+
| `Pekka Klärck <https://github.com/pekkaklarck>`__
269+
| Robot Framework Lead Developer
270+
271+
272+
Full list of fixes and enhancements
273+
===================================
274+
275+
.. list-table::
276+
:header-rows: 1
277+
278+
* - ID
279+
- Type
280+
- Priority
281+
- Summary
282+
- Added
283+
* - `#3622`_
284+
- enhancement
285+
- critical
286+
- New `SKIP` status
287+
- alpha 1
288+
* - `#3624`_
289+
- enhancement
290+
- critical
291+
- Remove criticality concept in favor of skip status
292+
- alpha 1
293+
* - `#3487`_
294+
- enhancement
295+
- high
296+
- Allow using `@{list}[index]` as a list and `&{dict}[key]` as a dict
297+
- alpha 1
298+
* - `#3687`_
299+
- enhancement
300+
- high
301+
- Libdoc html UX responsive improvements.
302+
- alpha 1
303+
* - `#3695`_
304+
- enhancement
305+
- high
306+
- Positional only argument support with Python keywords
307+
- alpha 1
308+
* - `#3547`_
309+
- bug
310+
- medium
311+
- Some non-iterable objects considered iterable
312+
- alpha 1
313+
* - `#3649`_
314+
- bug
315+
- medium
316+
- XML: Setting element text to `none` (case-insensitively) doesn't work
317+
- alpha 1
318+
* - `#3681`_
319+
- bug
320+
- medium
321+
- Evaluate: NameError - variable not recognized
322+
- alpha 1
323+
* - `#3708`_
324+
- bug
325+
- medium
326+
- Libdoc: Automatic table of contents generation does not work with spec files when using XML:HTML format
327+
- alpha 1
328+
* - `#2294`_
329+
- enhancement
330+
- medium
331+
- Run Keyword And Warn On Failure keyword
332+
- alpha 1
333+
* - `#3577`_
334+
- enhancement
335+
- medium
336+
- Drop Python 3.4 support
337+
- alpha 1
338+
* - `#3685`_
339+
- enhancement
340+
- medium
341+
- Expose special exceptions via `robot.api`
342+
- alpha 1
343+
* - `#3691`_
344+
- enhancement
345+
- low
346+
- Document omitting files starting with `.` or `_` when running a directory better
347+
- alpha 1
348+
349+
Altogether 13 issues. View on the `issue tracker <https://github.com/robotframework/robotframework/issues?q=milestone%3Av4.0>`__.
350+
351+
.. _#3622: https://github.com/robotframework/robotframework/issues/3622
352+
.. _#3624: https://github.com/robotframework/robotframework/issues/3624
353+
.. _#3487: https://github.com/robotframework/robotframework/issues/3487
354+
.. _#3687: https://github.com/robotframework/robotframework/issues/3687
355+
.. _#3695: https://github.com/robotframework/robotframework/issues/3695
356+
.. _#3547: https://github.com/robotframework/robotframework/issues/3547
357+
.. _#3649: https://github.com/robotframework/robotframework/issues/3649
358+
.. _#3681: https://github.com/robotframework/robotframework/issues/3681
359+
.. _#3708: https://github.com/robotframework/robotframework/issues/3708
360+
.. _#2294: https://github.com/robotframework/robotframework/issues/2294
361+
.. _#3577: https://github.com/robotframework/robotframework/issues/3577
362+
.. _#3685: https://github.com/robotframework/robotframework/issues/3685
363+
.. _#3691: https://github.com/robotframework/robotframework/issues/3691

0 commit comments

Comments
 (0)