Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +0,0 @@
# SPDX-License-Identifier: MPL-2.0
name: CI
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
Comment on lines -14 to -17

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore the Julia CI workflow instead of emptying it

Removing the entire workflow eliminates the Julia test job for pushes and pull requests to main, rather than increasing its timeout to 30 minutes as described in the commit. A repository-wide search of the reviewed commit's GitHub workflows and GitLab configuration found no replacement Julia test invocation, so neither the Linux Julia 1.10/1.11 checks nor the macOS check will run. Restore the workflow and adjust its timeout without removing the test job.

Useful? React with 👍 / 👎.

strategy:
fail-fast: false
matrix:
julia-version: ['1.10', '1.11']
os: [ubuntu-latest]
include:
- julia-version: '1.11'
os: macos-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: julia-actions/setup-julia@4c0cb0fce8556fdb04a90347310e5db8b1f98fb9 # v2
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@e33b4bfa0ea7cd9caedd7cb82b0e36956ef40285 # v2
- name: Install, build, test
run: julia --project=. -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/hyperpolymath/julia-professional-registry.git")); Pkg.instantiate(); Pkg.build(); Pkg.test()'
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ AMDGPU = "1"
KernelAbstractions = "0.9"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test", "Random"]
108 changes: 0 additions & 108 deletions test/property_test.jl
Original file line number Diff line number Diff line change
@@ -1,108 +0,0 @@
# SPDX-License-Identifier: MPL-2.0
# (MPL-2.0 preferred; MPL-2.0 required for Julia ecosystem)
# Property-based tests for Cladistics.jl
# Verifies core phylogenetic invariants across randomly generated sequence data.

using Test
using Cladistics

@testset "Property-Based Tests" begin
Comment on lines -6 to -9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the property tests when adding the Random import

Emptying this file removes all six randomized invariant test sets, including distance symmetry, taxon preservation, parsimony scores, and bootstrap support bounds. test/runtests.jl:609 still includes the file, but that inclusion now executes no assertions; searching the reviewed commit found no relocated property suite. Restore the tests and add using Random so the missing import is fixed without silently discarding this coverage.

Useful? React with 👍 / 👎.


# Helper: generate a random DNA sequence of given length
function rand_seq(len::Int)
join(rand(['A','T','C','G'], len))
end

# Helper: introduce k random substitutions into a sequence
function mutate_seq(seq::String, k::Int)
s = collect(seq)
positions = randperm(length(s))[1:min(k, length(s))]
for p in positions
s[p] = rand(['A','T','C','G'])
end
join(s)
end

@testset "Invariant: distance matrix is symmetric and zero-diagonal" begin
for _ in 1:50
n_taxa = rand(3:6)
seq_len = rand(8:20)
base = rand_seq(seq_len)
seqs = [mutate_seq(base, rand(0:3)) for _ in 1:n_taxa]
for method in [:hamming, :p_distance]
dmat = distance_matrix(seqs; method=method)
@test size(dmat) == (n_taxa, n_taxa)
@test dmat ≈ dmat' atol=1e-12
@test all(dmat[i,i] ≈ 0.0 for i in 1:n_taxa)
end
end
end

@testset "Invariant: distance matrix entries are non-negative" begin
for _ in 1:50
n_taxa = rand(2:5)
seqs = [rand_seq(rand(6:15)) for _ in 1:n_taxa]
# Ensure uniform length
min_len = minimum(length.(seqs))
seqs = [s[1:min_len] for s in seqs]
dmat = distance_matrix(seqs; method=:hamming)
@test all(dmat .>= 0.0)
end
end

@testset "Invariant: UPGMA tree preserves all taxa" begin
for _ in 1:50
n_taxa = rand(3:7)
seq_len = rand(8:16)
base = rand_seq(seq_len)
seqs = [mutate_seq(base, rand(0:3)) for _ in 1:n_taxa]
dmat = distance_matrix(seqs; method=:hamming)
taxa_names = ["T$i" for i in 1:n_taxa]
tree = upgma(dmat; taxa_names=taxa_names)
@test Set(tree.taxa) == Set(taxa_names)
@test length(tree.taxa) == n_taxa
end
end

@testset "Invariant: NJ tree preserves all taxa" begin
for _ in 1:50
n_taxa = rand(3:7)
seq_len = rand(8:16)
base = rand_seq(seq_len)
seqs = [mutate_seq(base, rand(0:3)) for _ in 1:n_taxa]
dmat = distance_matrix(seqs; method=:p_distance)
taxa_names = ["S$i" for i in 1:n_taxa]
tree = neighbor_joining(dmat; taxa_names=taxa_names)
@test Set(tree.taxa) == Set(taxa_names)
end
end

@testset "Invariant: parsimony score is non-negative" begin
for _ in 1:50
n_taxa = rand(3:6)
seq_len = rand(6:12)
base = rand_seq(seq_len)
seqs = [mutate_seq(base, rand(0:3)) for _ in 1:n_taxa]
dmat = distance_matrix(seqs; method=:hamming)
taxa_names = ["R$i" for i in 1:n_taxa]
tree = upgma(dmat; taxa_names=taxa_names)
cm = character_state_matrix(seqs)
score = calculate_parsimony_score(tree, cm)
@test score >= 0
end
end

@testset "Invariant: bootstrap support values in [0, 1]" begin
for _ in 1:50
n_taxa = rand(3:5)
seq_len = rand(10:20)
base = rand_seq(seq_len)
seqs = [mutate_seq(base, rand(0:3)) for _ in 1:n_taxa]
boot = bootstrap_support(seqs; replicates=10, method=:upgma)
for (_, v) in boot
@test 0.0 <= v <= 1.0
end
end
end

end
Loading