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

Unable to run tests programmatically #224

Open
dingyuchen opened this issue Sep 24, 2021 · 1 comment
Open

Unable to run tests programmatically #224

dingyuchen opened this issue Sep 24, 2021 · 1 comment

Comments

@dingyuchen
Copy link
Contributor

It is hard to pinpoint a program and Execute a trace recording to compare 2 traces for correctness.

From within the microbat_instrumentator project, we do not have access to programmatically access the eclipse dropins directory.
From the microbat main plugin project, we cannot generate the AppClassPath as it requires the caller to be an Eclipse instance ( there will be a "Workspace not open error").

On the other hand, a manually written command is also unable to perform a trace recording. I currently suspect that the target program needs to follow a certain project structure in order for the instrumentation to occur.
The current test runner records no trace. Upon debugging the instrumentator, it seems like none of the callbacks are hit.

Sample command in question:

/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -ea -noverify -javaagent:/home/dingyuchen/microbat/microbat/lib/instrumentator.jar=precheck=false,stepLimit=14090898,java_home=/usr/lib/jvm/java-1.8.0-openjdk-amd64,log=printProgress:error,varLayer=2,working_dir=/home/dingyuchen/microbat/microbat_instrumentator/src/test/java/microbat/instrumentation/trace/testdata,trace_recorder=FILE,launch_class=microbat.instrumentation.trace.testdata.Sample,class_path=/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/junit.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/org.hamcrest.core.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/testrunner.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/bcel-6.0.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/javassist.jar:/home/dingyuchen/microbat/microbat_instrumentator/bin:/home/dingyuchen/microbat/microbat_instrumentator/src:/home/dingyuchen/microbat/microbat_instrumentator,entry_point="microbat.instrumentation.trace.testdata.Sample.main([Ljava/lang/String;)V",dump_file_path=/tmp/trace8635584115944053561.exec -cp /home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/junit.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/org.hamcrest.core.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/testrunner.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/bcel-6.0.jar:/home/dingyuchen/eclipse/committers-2021-03/eclipse/dropins/junit_lib/javassist.jar:/home/dingyuchen/microbat/microbat_instrumentator/bin:/home/dingyuchen/microbat/microbat_instrumentator/src:/home/dingyuchen/microbat/microbat_instrumentator microbat.instrumentation.trace.testdata.Sample
@dingyuchen
Copy link
Contributor Author

As a patch, I will write a script to run a working command on the simple test programs in microbat_experiment and store the file record in to a folder.
Subsequent runs will read trace contents from file and compare the equality of both runs.

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

No branches or pull requests

1 participant