I am looking for a "counter-example" to integration by parts of the following type:
$\Omega \subseteq \mathbb R^n$ is an open, bounded, connected domain with smooth boundary. $u,v:\bar \Omega \to \mathbb R$ are real-valued functions, where $u$ is smooth and compactly supported in $\Omega$, and $v$ is smooth on an open subset of $\bar \Omega$ whose complement is a closed subset of measure zero. I want $\int_{\Omega}(\partial_iu)v \neq -\int_{\Omega}u(\partial_iv)$, i.e. to demonstrate failure of integration by parts.
Edit:
Does the answer change if we assume in addition that $v$ is continuous everywhere on $\bar \Omega$?. BigbearZzz gave here an example with a non-continuous $v$.
If $v$ was smooth on all $\bar \Omega$, then integration by parts would work. The point is that I am limiting the singular set to be closed and of measure zero. I guess integration by parts still cannot be saved, but I don't have a concrete example.

I am a bit confused by the question, please tell me if I misread anything.
Consider the domain $\Omega=B_1\subset\Bbb R^2$, i.e. the unit ball. Define $v$ to be $$ v(x)=\begin{cases}1 &; x<0 \\ 0 &; x\ge 0. \end{cases} $$ We can see that $v$ is smooth on $\overline\Omega\backslash l$, where $l=\{(x,y)\in\Bbb R^2 : x=0\}$ which is a closed set of measure zero.
Next, we take $\varphi\in C^\infty_c(\Omega)$. Since $\nabla v(x)=0$ a.e., we have $$ \int_\Omega \varphi \partial_i v = 0. $$ On the other hand, we have $$\begin{align} \int_\Omega(\partial_1\varphi)v = \int_{-1}^1 \varphi(0,y)\, dy \end{align}$$ since the distributional derivative of $v$ is the Hausdorff measure on $l$.