Is it allowed to put a GFCI outlet on a kitchen outlet that is not grounded, only 2 wires?
Don't you need to replace the circuit line with one that has the ground?
A GFCI receptacle operates by sensing the difference between the current on the hot lead and the neutral lead. It does not require a ground connection to do that.
Also, the test button on the receptacle works by diverting a small amount of current around the differential sensor and so does not require a ground either.
But if an owner, home inspector or other person tries to test the receptacle with a plug in tester, which works by sending some current from the hot lead to the EGC (ground wire), it will not trip.
That is a limitation of the tester, not an indication that the GFCI is not working. This problem comes up from time to time and the UL is very clear that the only test that means anything is the test button on the receptacle itself.