<commit_before>#!/usr/bin/env bats

load helpers

function teardown() {
	stop_manager
	stop_docker
}

@test "docker info should return the number of nodes" {
	start_docker 3
	start_manager
	run docker_swarm info
	[ "$status" -eq 0 ]
	[[ "${lines[1]}" == *"Nodes: 3" ]]
}

@test "docker ps -n 3 should return the 3 last containers, including non running one" {
skip
       start_docker 1
       start_manager
       run docker_swarm run -d busybox sleep 42
       run docker_swarm run -d busybox false
       run docker_swarm run -d busybox true
       run docker_swarm ps -a -n 3
       [ "${#lines[@]}" -eq  3 ]
}

@test "docker ps -l should return the last container, including non running one" {
skip
       start_docker 1
       start_manager
       run docker_swarm run -d busybox sleep 42
       run docker_swarm run -d busybox false
       run docker_swarm run -d busybox true
       run docker_swarm ps -l
       [ "${#lines[@]}" -eq  2 ]
       [[ "${lines[1]}" == *"true"* ]]
}<commit_msg>unskip and fix a few tests<commit_after>#!/usr/bin/env bats

load helpers

function teardown() {
	stop_manager
	stop_docker
}

@test "docker info should return the number of nodes" {
	start_docker 3
	start_manager
	run docker_swarm info
	[ "$status" -eq 0 ]
	[[ "${lines[1]}" == *"Nodes: 3" ]]
}

@test "docker ps -n 3 should return the 3 last containers, including non running one" {
       start_docker 1
       start_manager
       run docker_swarm run -d busybox sleep 42
       run docker_swarm run -d busybox false
       run docker_swarm ps -n 3
       [ "${#lines[@]}" -eq  3 ]

       run docker_swarm run -d busybox true
       run docker_swarm ps -n 3
       [ "${#lines[@]}" -eq  4 ]

       run docker_swarm run -d busybox true
       run docker_swarm ps -n 3
       [ "${#lines[@]}" -eq  4 ]
}

@test "docker ps -l should return the last container, including non running one" {
       start_docker 1
       start_manager
       run docker_swarm run -d busybox sleep 42
       sleep 1 #sleep so the 2 containers don't start at the same second
       run docker_swarm run -d busybox true
       run docker_swarm ps -l
       [ "${#lines[@]}" -eq  2 ]
       [[ "${lines[1]}" == *"true"* ]]

       sleep 1 #sleep so the container doesn't start at the same second as 'busybox true'
       run docker_swarm run -d busybox false
       run docker_swarm ps -l
       [ "${#lines[@]}" -eq  2 ]
       [[ "${lines[1]}" == *"false"* ]]
}
{'fraction_non_alphanumeric': 0.11061040557148709, 'fraction_numerical': 0.016796394920114706, 'mean_word_length': 2.4638297872340424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3069737', 'n_tokens_mistral': 868, 'n_tokens_neox': 792, 'n_words': 303}