I am new to Automated Testing :: GitLab cannot find JUnit and src/tests

  • What are you seeing, and how does that differ from what you expect to see?

Symbols not found in CI/CD pipeline terminal. For example:

src\tests\enemies_test.java:3: error: package org.junit does not exist
import org.junit.Test;
^
src\tests\enemies_test.java:8: error: package org.junit does not exist
import static org.junit.Assert.*;
^
src\tests\enemies_test.java:11: error: cannot find symbol
ArrayList enemies = new ArrayList<>();
^
symbol: class Enemy
location: class enemies_test
src\tests\enemies_test.java:12: error: cannot find symbol
Enemy enemy1 = new Enemy(null,10,30,30,new Location(0,2),false);
^
symbol: class Enemy
location: class enemies_test
src\tests\enemies_test.java:13: error: cannot find symbol
Enemy enemyStrong = new Enemy(“strong”,10,150,50,new Location(1,0),false);
^
symbol: class Enemy
location: class enemies_test

  • What version are you on? Are you using self-managed or GitLab.com?

    • GitLab (Hint: /help): git version 2.30.0.windows.2
    • Runner (Hint: /admin/runners): 15.3.0
  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

  1. I am unsure if the JUnit JAR file located on my local PC should be referenced in the yml file.
  2. I don’t understand why src.tests cannot be found by GitLab.