Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for annotation default value instrumentation #174

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

IlyaMuravjov
Copy link
Collaborator

Instrumenting annotation classes causes default values to get lost. In the added test UTestExecutionExceptionResult is returned with the following exception message:

example.MyAnnotation missing element x

Here are the logs:

Debug | ByteBufferAsyncProcessor  | 1:Test worker @coroutine#147 | PAUSE ('Socket not connected') :: {id = usvm-executor-socket/Sender, state = 'Initialized'} 
Debug | Server                    | 99:usvm-executor-socket | usvm-executor-socket: listening /127.0.0.1:33153 
Debug | Server                    | 99:usvm-executor-socket | usvm-executor-socket : connected 
Debug | ByteBufferAsyncProcessor  | 99:usvm-executor-socket | RESUME :: {id = usvm-executor-socket/Sender, state = 'AsyncProcessing'} 

org.opentest4j.AssertionFailedError: Expected value to be of type <org.usvm.instrumentation.testcase.api.UTestExecutionSuccessResult>, actual <class org.usvm.instrumentation.testcase.api.UTestExecutionExceptionResult>.
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)
	at org.junit.jupiter.api.Assertions.fail(Assertions.java:109)
	at kotlin.test.junit5.JUnit5Asserter.fail(JUnitSupport.kt:56)
	at kotlin.test.Asserter$DefaultImpls.assertTrue(Assertions.kt:652)
	at kotlin.test.junit5.JUnit5Asserter.assertTrue(JUnitSupport.kt:30)
	at kotlin.test.AssertionsKt__AssertionsKt.assertIsOfType(Assertions.kt:122)
	at kotlin.test.AssertionsKt.assertIsOfType(Unknown Source)
	at org.usvm.instrumentation.executor.ConcreteExecutorTests$annotation default value test$1.invokeSuspend(ConcreteExecutorTests.kt:89)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at org.usvm.instrumentation.executor.UTestConcreteExecutorTest.executeTest(UTestConcreteExecutorTest.kt:45)
	at org.usvm.instrumentation.executor.ConcreteExecutorTests.annotation default value test(ConcreteExecutorTests.kt:86)
	...

@IlyaMuravjov IlyaMuravjov merged commit aca7b5d into main Mar 1, 2024
1 check passed
@IlyaMuravjov IlyaMuravjov deleted the ilya_m/annotation-default-value-instrumentation branch March 1, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants