Compression test...
Checks to see if the combustion chamber is fine or compromised.
Dry test checks piston rings against cylinder walls, valves against seats, blown head gasket, cracked head. But you don't know the culprit until tear down.
If two adjacent cylinders share a low reading it points towards a blown head gasket and/or cracked head.
Wet test (some oil) if the above test was performed and one cylinder was lower this will determine bad rings if the compression test is higher.
If lower than should be compression in all cylinders could be crank and cam out of sync. Example, timing chain jumped. Or possibly badly burnt valves or carbon deposits not allowing valves to properly seat.
What a compression test won't tell you (short list).
Bad bearings such as rod bearings worn enough to cause rod knock.
Worn piston pins allowing knocking from pin to rod or pin to piston.
Slightly worn pistons (tapper effect) slapping against piston walls.
A compression test is not necessarily one of my first test to run when diagnosing a problem. Unless there is oil in the anti-freeze, anti-freeze in the oil, smoke in the exhaust.
That's why a stethoscope is an important diagnostic tool. Not only can you pin point where the knocking is coming from it can be used for such things as what is squealing - alternator, water pump, tenshion pulley, idler pulley, A/C compressor, etc...