mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-12-04 14:29:54 +00:00
test: Update testing framework to support iterators
This commit is contained in:
parent
737834224d
commit
91ef9fb65a
2 changed files with 25 additions and 21 deletions
|
@ -21,16 +21,17 @@ function nf_release_gen(version_number: string): NextflowRelease {
|
||||||
}
|
}
|
||||||
|
|
||||||
// A mock set of Nextflow releases
|
// A mock set of Nextflow releases
|
||||||
const edge_is_newer = [
|
async function* edge_is_newer(): AsyncGenerator<NextflowRelease> {
|
||||||
nf_release_gen("v23.09.1-edge"),
|
yield nf_release_gen("v23.09.1-edge")
|
||||||
nf_release_gen("v23.04.3"),
|
yield nf_release_gen("v23.04.3")
|
||||||
nf_release_gen("v23.04.2")
|
yield nf_release_gen("v23.04.2")
|
||||||
]
|
}
|
||||||
const edge_is_older = [
|
|
||||||
nf_release_gen("v23.04.3"),
|
async function* edge_is_older(): AsyncGenerator<NextflowRelease> {
|
||||||
nf_release_gen("v23.04.2"),
|
yield nf_release_gen("v23.04.3")
|
||||||
nf_release_gen("v23.03.0-edge")
|
yield nf_release_gen("v23.04.2")
|
||||||
]
|
yield nf_release_gen("v23.03.0-edge")
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The whole reason this action exists is to handle the cases where a final
|
The whole reason this action exists is to handle the cases where a final
|
||||||
|
@ -44,7 +45,7 @@ const release_filter_macro = test.macro(
|
||||||
t,
|
t,
|
||||||
input_version: string,
|
input_version: string,
|
||||||
expected_version: string,
|
expected_version: string,
|
||||||
releases: NextflowRelease[]
|
releases: AsyncGenerator<NextflowRelease>
|
||||||
) => {
|
) => {
|
||||||
const matched_release = await functions.get_nextflow_release(
|
const matched_release = await functions.get_nextflow_release(
|
||||||
input_version,
|
input_version,
|
||||||
|
@ -58,56 +59,56 @@ test(
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"latest-everything",
|
"latest-everything",
|
||||||
"v23.09.1-edge",
|
"v23.09.1-edge",
|
||||||
edge_is_newer
|
edge_is_newer()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Latest-everything install with older edge release",
|
"Latest-everything install with older edge release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"latest-everything",
|
"latest-everything",
|
||||||
"v23.04.3",
|
"v23.04.3",
|
||||||
edge_is_older
|
edge_is_older()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Latest-edge install with newer edge release",
|
"Latest-edge install with newer edge release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"latest-edge",
|
"latest-edge",
|
||||||
"v23.09.1-edge",
|
"v23.09.1-edge",
|
||||||
edge_is_newer
|
edge_is_newer()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Latest-edge install with older edge release",
|
"Latest-edge install with older edge release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"latest-edge",
|
"latest-edge",
|
||||||
"v23.03.0-edge",
|
"v23.03.0-edge",
|
||||||
edge_is_older
|
edge_is_older()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Latest-stable install with newer edge release",
|
"Latest-stable install with newer edge release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"latest",
|
"latest",
|
||||||
"v23.04.3",
|
"v23.04.3",
|
||||||
edge_is_newer
|
edge_is_newer()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Latest-stable install with older edge release",
|
"Latest-stable install with older edge release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"latest",
|
"latest",
|
||||||
"v23.04.3",
|
"v23.04.3",
|
||||||
edge_is_older
|
edge_is_older()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Fully versioned tag release",
|
"Fully versioned tag release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"v23.04.2",
|
"v23.04.2",
|
||||||
"v23.04.2",
|
"v23.04.2",
|
||||||
edge_is_newer
|
edge_is_newer()
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
"Partially versioned tag release",
|
"Partially versioned tag release",
|
||||||
release_filter_macro,
|
release_filter_macro,
|
||||||
"v23.04",
|
"v23.04",
|
||||||
"v23.04.3",
|
"v23.04.3",
|
||||||
edge_is_newer
|
edge_is_newer()
|
||||||
)
|
)
|
||||||
|
|
||||||
test.todo("install_nextflow")
|
test.todo("install_nextflow")
|
||||||
|
|
|
@ -2,8 +2,11 @@ import * as github from "@actions/github"
|
||||||
import { GitHub } from "@actions/github/lib/utils"
|
import { GitHub } from "@actions/github/lib/utils"
|
||||||
import anyTest, { TestFn } from "ava" // eslint-disable-line import/no-unresolved
|
import anyTest, { TestFn } from "ava" // eslint-disable-line import/no-unresolved
|
||||||
|
|
||||||
import { nextflow_bin_url } from "../src/nextflow-release"
|
import { NextflowRelease } from "../src/nextflow-release"
|
||||||
import { all_nf_release_data } from "../src/octokit-wrapper"
|
import {
|
||||||
|
pull_latest_stable_release,
|
||||||
|
pull_releases
|
||||||
|
} from "../src/octokit-wrapper"
|
||||||
import { getToken } from "./utils"
|
import { getToken } from "./utils"
|
||||||
|
|
||||||
const test = anyTest as TestFn<{
|
const test = anyTest as TestFn<{
|
||||||
|
|
Loading…
Reference in a new issue