Eighteen tests reported PASSED while running nothing
`val url = base ?: return` from an unmet precondition makes a test that did nothing report as a pass. FN_LIVE_FLEET is never set in CI, so eighteen tests across five files did this on every pipeline: LiveKeyLogTest 7, LiveConversationTest 6, LiveRelayTest 2, LiveSealedSenderTest 2, LiveSignUpTest 1. 🔴 This repository had already written the rule down. LiveShapesTest uses `assumeTrue` and says why, in its own words: a suite of tests that did nothing is indistinguishable from a suite that works. Two files followed that and five did not, so this is a consistency fix rather than a new idea. It nearly reached the specification. `LiveSealedSenderTest` was the evidence §15 would have cited for "Android sealed sender, wired end to end" — two tests, zero skipped, zero failures, on a run that did nothing. Only reading the source shows that, and a status table is exactly where nobody would. ⚠️ The suite now looks worse and is not. Client goes from "277 tests, 0 failures" to "277 tests, 28 skipped" — the 28 were always doing nothing; the number was wrong before, not now. 578 of 606 actually run.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package io.flamenet.client
|
package io.flamenet.client
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
||||||
import io.flamenet.e2e.DeviceIdentity
|
import io.flamenet.e2e.DeviceIdentity
|
||||||
import io.flamenet.e2e.Vault
|
import io.flamenet.e2e.Vault
|
||||||
import javax.crypto.KeyGenerator
|
import javax.crypto.KeyGenerator
|
||||||
@@ -24,6 +25,18 @@ class LiveConversationTest {
|
|||||||
|
|
||||||
private val fleet: String? = System.getenv("FN_LIVE_FLEET")
|
private val fleet: String? = System.getenv("FN_LIVE_FLEET")
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ⚠️ **Skips are announced, not silent.** `return` from an unmet
|
||||||
|
* precondition makes a test that did nothing report as PASSED, and a suite
|
||||||
|
* of those is indistinguishable from a suite that works. `assumeTrue`
|
||||||
|
* reports SKIPPED, which is the truth. `LiveShapesTest` has always done it
|
||||||
|
* this way; these files did not, so 6 tests here reported green on every
|
||||||
|
* pipeline while running nothing at all.
|
||||||
|
*/
|
||||||
|
private fun needFnLiveFleet() = assumeTrue(
|
||||||
|
fleet != null, "set FN_LIVE_FLEET to run this against a relay")
|
||||||
|
|
||||||
/** A signed-up account with a registered device, ready to talk. */
|
/** A signed-up account with a registered device, ready to talk. */
|
||||||
private class Person(
|
private class Person(
|
||||||
val handle: String,
|
val handle: String,
|
||||||
@@ -88,7 +101,8 @@ class LiveConversationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `two people exchange messages through a real relay`() {
|
fun `two people exchange messages through a real relay`() {
|
||||||
val base = fleet ?: return
|
needFnLiveFleet()
|
||||||
|
val base = fleet!!
|
||||||
val alice = signUp(base, "a")
|
val alice = signUp(base, "a")
|
||||||
val bob = signUp(base, "b")
|
val bob = signUp(base, "b")
|
||||||
|
|
||||||
@@ -128,7 +142,8 @@ class LiveConversationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `polling twice does not deliver the same message twice`() {
|
fun `polling twice does not deliver the same message twice`() {
|
||||||
val base = fleet ?: return
|
needFnLiveFleet()
|
||||||
|
val base = fleet!!
|
||||||
val alice = signUp(base, "c")
|
val alice = signUp(base, "c")
|
||||||
val bob = signUp(base, "d")
|
val bob = signUp(base, "d")
|
||||||
|
|
||||||
@@ -146,7 +161,8 @@ class LiveConversationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a message reaches every device a person has`() {
|
fun `a message reaches every device a person has`() {
|
||||||
val base = fleet ?: return
|
needFnLiveFleet()
|
||||||
|
val base = fleet!!
|
||||||
val alice = signUp(base, "e")
|
val alice = signUp(base, "e")
|
||||||
val bob = signUp(base, "f")
|
val bob = signUp(base, "f")
|
||||||
|
|
||||||
@@ -176,7 +192,8 @@ class LiveConversationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `the relay never sees the plaintext`() {
|
fun `the relay never sees the plaintext`() {
|
||||||
val base = fleet ?: return
|
needFnLiveFleet()
|
||||||
|
val base = fleet!!
|
||||||
val alice = signUp(base, "g")
|
val alice = signUp(base, "g")
|
||||||
val bob = signUp(base, "h")
|
val bob = signUp(base, "h")
|
||||||
|
|
||||||
@@ -202,7 +219,8 @@ class LiveConversationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `an image crosses end to end and the relay cannot read it`() {
|
fun `an image crosses end to end and the relay cannot read it`() {
|
||||||
val base = fleet ?: return
|
needFnLiveFleet()
|
||||||
|
val base = fleet!!
|
||||||
val alice = signUp(base, "i")
|
val alice = signUp(base, "i")
|
||||||
val bob = signUp(base, "j")
|
val bob = signUp(base, "j")
|
||||||
|
|
||||||
@@ -242,7 +260,8 @@ class LiveConversationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a group is created, described and messaged`() {
|
fun `a group is created, described and messaged`() {
|
||||||
val base = fleet ?: return
|
needFnLiveFleet()
|
||||||
|
val base = fleet!!
|
||||||
val alice = signUp(base, "k")
|
val alice = signUp(base, "k")
|
||||||
val bob = signUp(base, "l")
|
val bob = signUp(base, "l")
|
||||||
val carol = signUp(base, "m")
|
val carol = signUp(base, "m")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.flamenet.client
|
package io.flamenet.client
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
||||||
import io.flamenet.e2e.DeviceIdentity
|
import io.flamenet.e2e.DeviceIdentity
|
||||||
import io.flamenet.e2e.Vault
|
import io.flamenet.e2e.Vault
|
||||||
import javax.crypto.KeyGenerator
|
import javax.crypto.KeyGenerator
|
||||||
@@ -27,6 +28,18 @@ class LiveKeyLogTest {
|
|||||||
|
|
||||||
private val base: String? = System.getenv("FN_LIVE_FLEET")
|
private val base: String? = System.getenv("FN_LIVE_FLEET")
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ⚠️ **Skips are announced, not silent.** `return` from an unmet
|
||||||
|
* precondition makes a test that did nothing report as PASSED, and a suite
|
||||||
|
* of those is indistinguishable from a suite that works. `assumeTrue`
|
||||||
|
* reports SKIPPED, which is the truth. `LiveShapesTest` has always done it
|
||||||
|
* this way; these files did not, so 7 tests here reported green on every
|
||||||
|
* pipeline while running nothing at all.
|
||||||
|
*/
|
||||||
|
private fun needFnLiveFleet() = assumeTrue(
|
||||||
|
base != null, "set FN_LIVE_FLEET to run this against a relay")
|
||||||
|
|
||||||
private class MapStorage : Vault.Storage {
|
private class MapStorage : Vault.Storage {
|
||||||
val records = LinkedHashMap<String, ByteArray>()
|
val records = LinkedHashMap<String, ByteArray>()
|
||||||
override fun read(name: String) = records[name]
|
override fun read(name: String) = records[name]
|
||||||
@@ -61,7 +74,8 @@ class LiveKeyLogTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `a key this relay really published verifies against its real log`() {
|
fun `a key this relay really published verifies against its real log`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "a")
|
val alice = Actor(url, "a")
|
||||||
val bob = Actor(url, "b")
|
val bob = Actor(url, "b")
|
||||||
|
|
||||||
@@ -88,7 +102,8 @@ class LiveKeyLogTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a key the relay never published is refused by the real log`() {
|
fun `a key the relay never published is refused by the real log`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "c")
|
val alice = Actor(url, "c")
|
||||||
val bob = Actor(url, "d")
|
val bob = Actor(url, "d")
|
||||||
|
|
||||||
@@ -118,7 +133,8 @@ class LiveKeyLogTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a later head reconciles with the head we pinned earlier`() {
|
fun `a later head reconciles with the head we pinned earlier`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "e")
|
val alice = Actor(url, "e")
|
||||||
val bob = Actor(url, "f")
|
val bob = Actor(url, "f")
|
||||||
|
|
||||||
@@ -147,7 +163,8 @@ class LiveKeyLogTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a root we never saw at our pinned size is a fork`() {
|
fun `a root we never saw at our pinned size is a fork`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "h")
|
val alice = Actor(url, "h")
|
||||||
val bob = Actor(url, "i")
|
val bob = Actor(url, "i")
|
||||||
|
|
||||||
@@ -178,7 +195,8 @@ class LiveKeyLogTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a contact carrying the peer's address verifies a key logged under it`() {
|
fun `a contact carrying the peer's address verifies a key logged under it`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "l")
|
val alice = Actor(url, "l")
|
||||||
val bob = Actor(url, "m")
|
val bob = Actor(url, "m")
|
||||||
|
|
||||||
@@ -228,7 +246,8 @@ class LiveKeyLogTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a peer whose address changes is reported as an identity change`() {
|
fun `a peer whose address changes is reported as an identity change`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "n")
|
val alice = Actor(url, "n")
|
||||||
val bob = Actor(url, "o")
|
val bob = Actor(url, "o")
|
||||||
|
|
||||||
@@ -256,7 +275,8 @@ class LiveKeyLogTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a send refuses when enforcement is on and the key is not logged`() {
|
fun `a send refuses when enforcement is on and the key is not logged`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "j")
|
val alice = Actor(url, "j")
|
||||||
val bob = Actor(url, "k")
|
val bob = Actor(url, "k")
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.flamenet.client
|
package io.flamenet.client
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
@@ -23,9 +24,22 @@ class LiveRelayTest {
|
|||||||
|
|
||||||
private val relay: String? = System.getenv("FN_LIVE_RELAY")
|
private val relay: String? = System.getenv("FN_LIVE_RELAY")
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ⚠️ **Skips are announced, not silent.** `return` from an unmet
|
||||||
|
* precondition makes a test that did nothing report as PASSED, and a suite
|
||||||
|
* of those is indistinguishable from a suite that works. `assumeTrue`
|
||||||
|
* reports SKIPPED, which is the truth. `LiveShapesTest` has always done it
|
||||||
|
* this way; these files did not, so 2 tests here reported green on every
|
||||||
|
* pipeline while running nothing at all.
|
||||||
|
*/
|
||||||
|
private fun needFnLiveRelay() = assumeTrue(
|
||||||
|
relay != null, "set FN_LIVE_RELAY to run this against a relay")
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `the deployed relay serves the routes this client asks for`() {
|
fun `the deployed relay serves the routes this client asks for`() {
|
||||||
val base = relay ?: return
|
needFnLiveRelay()
|
||||||
|
val base = relay!!
|
||||||
val head = RelayClient(base, username = "", appPassword = "").logHead()
|
val head = RelayClient(base, username = "", appPassword = "").logHead()
|
||||||
|
|
||||||
// `audience` is the hostname the relay signs under, and a mismatch
|
// `audience` is the hostname the relay signs under, and a mismatch
|
||||||
@@ -39,7 +53,8 @@ class LiveRelayTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `an inclusion proof from the deployed log verifies`() {
|
fun `an inclusion proof from the deployed log verifies`() {
|
||||||
val base = relay ?: return
|
needFnLiveRelay()
|
||||||
|
val base = relay!!
|
||||||
val client = RelayClient(base, username = "", appPassword = "")
|
val client = RelayClient(base, username = "", appPassword = "")
|
||||||
val head = client.logHead()
|
val head = client.logHead()
|
||||||
val size = head.getInt("size")
|
val size = head.getInt("size")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.flamenet.client
|
package io.flamenet.client
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
||||||
import io.flamenet.e2e.DeviceIdentity
|
import io.flamenet.e2e.DeviceIdentity
|
||||||
import io.flamenet.e2e.SealedSender
|
import io.flamenet.e2e.SealedSender
|
||||||
import io.flamenet.e2e.Vault
|
import io.flamenet.e2e.Vault
|
||||||
@@ -26,6 +27,18 @@ class LiveSealedSenderTest {
|
|||||||
|
|
||||||
private val base: String? = System.getenv("FN_LIVE_FLEET")
|
private val base: String? = System.getenv("FN_LIVE_FLEET")
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ⚠️ **Skips are announced, not silent.** `return` from an unmet
|
||||||
|
* precondition makes a test that did nothing report as PASSED, and a suite
|
||||||
|
* of those is indistinguishable from a suite that works. `assumeTrue`
|
||||||
|
* reports SKIPPED, which is the truth. `LiveShapesTest` has always done it
|
||||||
|
* this way; these files did not, so 2 tests here reported green on every
|
||||||
|
* pipeline while running nothing at all.
|
||||||
|
*/
|
||||||
|
private fun needFnLiveFleet() = assumeTrue(
|
||||||
|
base != null, "set FN_LIVE_FLEET to run this against a relay")
|
||||||
|
|
||||||
private class MapStorage : Vault.Storage {
|
private class MapStorage : Vault.Storage {
|
||||||
val records = LinkedHashMap<String, ByteArray>()
|
val records = LinkedHashMap<String, ByteArray>()
|
||||||
override fun read(name: String) = records[name]
|
override fun read(name: String) = records[name]
|
||||||
@@ -62,7 +75,8 @@ class LiveSealedSenderTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `a sealed message arrives and the relay records no sender`() {
|
fun `a sealed message arrives and the relay records no sender`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "a")
|
val alice = Actor(url, "a")
|
||||||
val bob = Actor(url, "b")
|
val bob = Actor(url, "b")
|
||||||
|
|
||||||
@@ -114,7 +128,8 @@ class LiveSealedSenderTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
fun `rotating the delivery key refuses submissions holding the old one`() {
|
fun `rotating the delivery key refuses submissions holding the old one`() {
|
||||||
val url = base ?: return
|
needFnLiveFleet()
|
||||||
|
val url = base!!
|
||||||
val alice = Actor(url, "c")
|
val alice = Actor(url, "c")
|
||||||
val bob = Actor(url, "d")
|
val bob = Actor(url, "d")
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.flamenet.client
|
package io.flamenet.client
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
||||||
import io.flamenet.e2e.DeviceIdentity
|
import io.flamenet.e2e.DeviceIdentity
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
@@ -21,9 +22,22 @@ class LiveSignUpTest {
|
|||||||
|
|
||||||
private val relay: String? = System.getenv("FN_LIVE_FLEET")
|
private val relay: String? = System.getenv("FN_LIVE_FLEET")
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ⚠️ **Skips are announced, not silent.** `return` from an unmet
|
||||||
|
* precondition makes a test that did nothing report as PASSED, and a suite
|
||||||
|
* of those is indistinguishable from a suite that works. `assumeTrue`
|
||||||
|
* reports SKIPPED, which is the truth. `LiveShapesTest` has always done it
|
||||||
|
* this way; these files did not, so 1 tests here reported green on every
|
||||||
|
* pipeline while running nothing at all.
|
||||||
|
*/
|
||||||
|
private fun needFnLiveFleet() = assumeTrue(
|
||||||
|
relay != null, "set FN_LIVE_FLEET to run this against a relay")
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `a new account can register a device and publish prekeys`() {
|
fun `a new account can register a device and publish prekeys`() {
|
||||||
val base = relay ?: return
|
needFnLiveFleet()
|
||||||
|
val base = relay!!
|
||||||
val handle = "jvmt" + (System.currentTimeMillis() % 100_000_000)
|
val handle = "jvmt" + (System.currentTimeMillis() % 100_000_000)
|
||||||
|
|
||||||
val account = RelayAccounts(base).signUp(
|
val account = RelayAccounts(base).signUp(
|
||||||
|
|||||||
Reference in New Issue
Block a user