Skip to content

Commit

Permalink
Updated search test to validate symlink target jobs are returned
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Collado <collado.mike@gmail.com>
  • Loading branch information
collado-mike committed Aug 1, 2022
1 parent 010c97b commit 0085f3e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/src/test/java/marquez/db/SearchDaoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class SearchDaoTest {
*/
static final int NUM_OF_DATASETS = 12;

public static final String NEW_SYMLINK_TARGET_JOB = "a_new_symlink_target_job";

static SearchDao searchDao;

@BeforeAll
Expand Down Expand Up @@ -75,7 +77,7 @@ public static void setUpOnce(final Jdbi jdbi) throws SQLException {
DbTestUtils.newJobWith(
jdbi,
namespaceRow.getName(),
"a_new_symlink_target_job",
NEW_SYMLINK_TARGET_JOB,
new JobMeta(
JobType.valueOf(j.getType()),
ImmutableSet.copyOf(j.getInputs()),
Expand Down Expand Up @@ -127,6 +129,12 @@ public void testSearch() {
final List<SearchResult> resultsWithOnlyJobs =
resultsGroupedByType.get(SearchResult.ResultType.JOB);
assertThat(resultsWithOnlyJobs).hasSize(NUM_OF_JOBS);

// Even though we searched for "test" and the symlink target doesn't have "test" in its name,
// it is part of the search results because the original job had "test" in its name.
assertThat(resultsWithOnlyJobs)
.filteredOn(j -> j.getName().equals(NEW_SYMLINK_TARGET_JOB))
.isNotEmpty();
}

@Test
Expand Down

0 comments on commit 0085f3e

Please sign in to comment.