<p>I have about half a dozen of integration tests (handled with Robot Framework) to run in a GitLab CI pipeline. Once upon a time, we did not care about the execution order of these tests. The corresponding code (extracted from the <code>.gitlab-ci.yml</code> file) then looked like the following:</p>

<pre><code>test:
  stage: test
  before_script:
    - pip install RobotNapalm
  script:
    - robot -b debug.log -d log/ ./*.robot
</code></pre>

<p>But now I need to run those tests in a specific order. What GitLab's doc says about the <code>script</code> keyword is that it can handle a handful of commands at once, and then it would look like the following:</p>

<pre><code>script:
  - robot -b debug.log -d log/ ./some-test.robot
  - robot -b debug.log -d log/ ./here-is-another-one.robot
  - robot -b debug.log -d log/ ./yet-another-test.robot
</code></pre>

<p>The doc yet does not say whether those <code>robot</code> commands would be handled simultaneously or sequentially. Knowing that I can't influence the tests execution order by giving them alphabetically sorted names, how could I ensure that those tests are executed in a particular order?</p>

CC BY-SA 4.0
2018-12-14T14:03:45.123Z
What you put in script will be executed sequentially as in bash script.
Tensibai
CC BY-SA 4.0
2018-12-14T14:05:18.597Z
@Tensibai Okay, then it'll be mandatory to sort them in alphabetical order I guess. Do you know of a way to give a specific execution order to GitLab CI?
avazula
CC BY-SA 4.0
2018-12-14T16:27:41.320Z
The order you write them is the order they will be executed.... there's no magic behind
Tensibai
<gitlab><testing><yaml><integration>
How to ensure testing execution order with GitLab CI?
avazula
# How to ensure testing execution order with GitLab CI?

(Asked by: username_0 on 2018-12-14)

I have about half a dozen of integration tests (handled with Robot Framework) to run in a GitLab CI pipeline. Once upon a time, we did not care about the execution order of these tests. The corresponding code (extracted from the .gitlab-ci.yml file) then looked like the following:
test:
  stage: test
  before_script:
    - pip install RobotNapalm
  script:
    - robot -b debug.log -d log/ ./*.robot

But now I need to run those tests in a specific order. What GitLab's doc says about the script keyword is that it can handle a handful of commands at once, and then it would look like the following:
script:
  - robot -b debug.log -d log/ ./some-test.robot
  - robot -b debug.log -d log/ ./here-is-another-one.robot
  - robot -b debug.log -d log/ ./yet-another-test.robot

The doc yet does not say whether those robot commands would be handled simultaneously or sequentially. Knowing that I can't influence the tests execution order by giving them alphabetically sorted names, how could I ensure that those tests are executed in a particular order?

**Tags:** gitlab, testing, yaml, integration

> **Comments:**
> **username_1**: What you put in script will be executed sequentially as in bash script.  
> **username_0**: @username_1 Okay, then it'll be mandatory to sort them in alphabetical order I guess. Do you know of a way to give a specific execution order to GitLab CI?  
> **username_1**: The order you write them is the order they will be executed.... there's no magic behind  

---

## 0 answers

