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

Major Repo Updates #2

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Major Repo Updates #2

wants to merge 12 commits into from

Conversation

1eyewonder
Copy link
Owner

@1eyewonder 1eyewonder commented Aug 24, 2024

Proposed Changes

Making updates per #1. This supports v3.9 of DotNet.TestContainers.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Build and tests pass locally
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Further comments

This is the just a first pass at creating the CI/CD pipeline, tooling updates, and API support. If momentum is gained, we can iterate on the current package.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@WillEhrendreich
Copy link

Hey, thanks for the update, again.

I got some time to check it out today, and I could get the CE to start a container, but I'm not sure how to use the more specific containers.

open Expecto
open Expecto.Flip
open FsToolkit
open Fs.TestContainers.Image
open Fs.TestContainers.Container
open Testcontainers
open DotNet.Testcontainers.Builders
open System
open DotNet.Testcontainers.Containers

let inline dump a =
  a
  |> Dumpify.DumpExtensions.Dump

let inline dumpt a =
  a
  |> Dumpify.DumpExtensions.DumpText
  |> printfn "%s"
  |> ignore

let inline dumpi a =
  a
  |> Dumpify.DumpExtensions.Dump
  |> ignore


[<Tests>]
let newApiTestContainerTests =
  testList "here is a stub for the stuff that I'm gonna do" [
    testCase
      "TestContainer"
      (fun () ->
        let container =
          container { imageName "mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04" }
          |> ContainerBuilder.build

        container.StartAsync()
        |> Async.AwaitTask
        |> Async.RunSynchronously


        container.IpAddress
        |> dumpi

        let msSql =
          MsSql
            .MsSqlBuilder()
            .WithImage("mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-22.04")
            .Build()

        msSql.StartAsync()
        |> Async.AwaitTask
        |> Async.RunSynchronously

        msSql
        |> dumpi

        "
        CREATE DATABASE TestDb;
        create table TestTable (id int, name varchar(255));
        insert into TestTable (id, name) values (1, 'test');
        insert into TestTable (id, name) values (2, 'test2');
        "
        |> msSql.ExecScriptAsync
        |> Async.AwaitTask
        |> Async.RunSynchronously
        |> ignore

        let execResult =
          "
        select * from TestTable;
        "
          |> msSql.ExecScriptAsync
          |> Async.AwaitTask
          |> Async.RunSynchronously

        execResult.Stdout
        |> dumpi


they both start, and have the same image in them, but I cannot, for instance, seem to use the ExecScriptAsync that comes from The MsSql.MsqlBuilder.

is there a way to get those specific containers to work with the CE?

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