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

Feature/oracle support #702

Merged
merged 8 commits into from
Oct 20, 2023
Merged

Feature/oracle support #702

merged 8 commits into from
Oct 20, 2023

Conversation

Curlack
Copy link
Contributor

@Curlack Curlack commented Oct 19, 2023

This covers all but one task. Not sure what to do for "Create a derived OracleManagedTestProvider class to derive from...".
These changes are for baseline Oracle setup. To confirm setup and build scripts work I ran PetaPoco.Tests.Integration.DatabaseTests.Construct_GivenConnection_ShouldBeValid, which executed successfully.

Add Oracle image to docker-compose.yml.
Update connection strings in app.config and appsetting.json.
Include "Oracle.ManagedDataAccess" nuget package.
Create Oracle -Setup and -Build scripts.
Create base OracleTestProvider.
Add OracleDatabaseTests.

Fix TODO I came accross in ParameterHelper class.
Fix script parsing issue found in code borrowed from MSAccessTestProvider during Oracle ExecuteBuildScript.
Introduce new ExecutionPhase enum in TestProvider to accomodate setup and build phases necessary in OracleTestProvider.

NOTE: Added SuppressTfmSupportBuildWarnings in project file to circumvent "System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.1" build error. Not sure how else to fix this issue.
@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

Looks fantastic based on a quick fly-by over the commit @Curlack. I'll take a look at everything between now and tomorrow.

Copy link
Collaborator

@Ste1io Ste1io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix script parsing issue found in code borrowed from MSAccessTestProvider during Oracle ExecuteBuildScript.

I'm curious what the script parsing bug was? Any chance it was related to 7e6c940?

@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

Everything looks good @Curlack. Just one non-code-related typo, which isn't me attempting to be nitpicky I promise. About the OracleManagedTestProvider, that really isn't necessary until/if another provider is added. That was mainly in light of the DbProviderFactory for Oracle.

Co-authored-by: Stelio Kontos <37424493+Ste1io@users.noreply.github.com>
@Curlack Curlack closed this Oct 20, 2023
@Curlack Curlack reopened this Oct 20, 2023
@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

Not used to aal these github features lol. Will learn I suppose.

I can relate...always afraid it will make some assumption I don't want and I'll regret it later (probably a result of back when I started using rebase for private branches and realized "Pull" defaults to Fetch/Merge), so tend to using VSCode integration or CLI directly in most cases.

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

NOTE: Added SuppressTfmSupportBuildWarnings in project file to circumvent "System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.1" build error. Not sure how else to fix this issue.

I checked out your branch and looking into this...with the warning suppressed, it builds but the test fails when ran under dotnet2.1 target. The offending package causing that error message is Oracle.ManagedDataAccess; which is odd that it doesn't affect net472, seeing as that dependency is considered the most current iirc.

For reference:

2>------ Rebuild All started: Project: PetaPoco.Tests.Integration, Configuration: Debug Any CPU ------
2>C:\Users\there\.nuget\packages\system.runtime.compilerservices.unsafe\6.0.0\buildTransitive\netcoreapp2.0\System.Runtime.CompilerServices.Unsafe.targets(4,5): error : System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.1. Consider updating your TargetFramework to netcoreapp3.1 or later.
2>Done building project "PetaPoco.Tests.Integration.csproj" -- FAILED.

@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

FYI, I wasn't able to build even before adding the Oracle nuget package.
Would like to know or try to figure out what to do so my build doesn't fail
without that change.

Can you copy the output log in here for me with the suppression and Oracle.ManagedDataAccess package removed from the project file?

For the time being used it like that to concentrate on
the important parts

Completely understand, I'm the same. Hence the TODO you found ;)

but figured you'd guide in the right direction if I
do include it, 'no harm no foul' kind of thing.

No harm done.

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

The offending package causing that error message is Oracle.ManagedDataAccess; which is odd that it doesn't affect net472, seeing as that dependency is considered the most current iirc.

OK, I was wrong here; Oracle.ManagedDataAccess is the framework version (hence no issues with net472 target). Oracle.ManagedDataAccess.Core is the "modern" package for core apps (click links for compatible versions on nuget).

Unfortunately, the lowest compatable dotnetcore version for the "Oracle.ManagedDataAccess.Core" package is dotnetcore3.1. Any ideas @Curlack?

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

Screw it, tests are getting updated to netcoreapp3.1. I'm running the full test suite rn, and will push the targetframeworks change in a separate PR to this branch to isolate it from these changes.

1697789162-PetaPoco_-_Microsoft_Visual_Studio

@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

Copy link
Collaborator

@Ste1io Ste1io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the suppression, and add a condition for the package. Oracle tests won't pass for netcoreapp2.1, but it should build fine (ie, no change from current state). Sets it up so we can roll in the 2.1->3.1 upgrade smoothly though.

Curlack and others added 2 commits October 20, 2023 10:29
Co-authored-by: Stelio Kontos <37424493+Ste1io@users.noreply.github.com>
Co-authored-by: Stelio Kontos <37424493+Ste1io@users.noreply.github.com>
@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

Had a good laugh after reading you comments.

Inline code comments or my half hazard PR thread comments? haha

Does that mean you don't need the output logs from me anymore?

If it compiled fine prior to adding the Oracle dependency, it's most likely because that package is not compatable with dotnetcore2.1. Removing the suppression broke my build also. If that's the case, no need sending the logs as updating the target should fix it for you as it did for me. If, after rebasing your branch onto my upcoming commit with the upgrade, you still have issues, let me know, but it should resolve it.

Copy link
Collaborator

@Ste1io Ste1io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you're at your pc and sync'd up with the changes here locally, @Curlack, could you rebase your feature branch onto upstream/feature/oracle-support, then add Oracle.ManagedDataAccess.Core package conditional to netcoreapp3.1 to the integration tests project file? Once that's committed/pushed this pr will be all set.

@Curlack Curlack requested a review from Ste1io October 20, 2023 20:52
@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

When I looked at the file I thought the same thing, but I didn't put it there. After installing the nuget package, it was like that all by itself lol.

No worries. I'm set to merge soon as that's sorted. Any issues building at this point?

@Curlack
Copy link
Contributor Author

Curlack commented Oct 20, 2023 via email

@Ste1io
Copy link
Collaborator

Ste1io commented Oct 20, 2023

Looks fantastic @Curlack. Let's get this Oracle merged in and see how he fairs with the tests :)

Merging Oracle 03

@Ste1io Ste1io merged commit eaf8e5f into CollaboratingPlatypus:feature/oracle-support Oct 20, 2023
@Ste1io Ste1io mentioned this pull request Nov 5, 2023
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.

None yet

2 participants