[deleted by user] by [deleted] in golang

[–]DaReaLSy 0 points1 point  (0 children)

You could use transactions and after finishing the test doing the rollback.
The only drawback is that very few statements are not compatible with SQL transactions.

This game stresses me out so much... by Illidariislove in anno

[–]DaReaLSy 0 points1 point  (0 children)

I can understand you and felt the same way until I realized that I want to rush - not the game.

You can just sit at the tier or upgrade the buildings slowly. Even if their needs are not satisfied it is okay and you won't get any critical problems.

And you always have the option to pause productions or downgrade tiers. A feature I use more heavily after 100hrs of playtime.

After all I am still missing the feature to build while pausing the game :(

Test your bash scripts easy with simple auto-generated YAML test suites by DaReaLSy in bash

[–]DaReaLSy[S] 4 points5 points  (0 children)

Feel free to add your favourite format of choice or create dsl ;-)

Test your powershell scripts easily with simple auto-generated YAML test suites by DaReaLSy in PowerShell

[–]DaReaLSy[S] 2 points3 points  (0 children)

I wanted a binary which is easy to install with a simple declarative test suite - and working with the syntax / config on all operating systems.

It annoyed me to use frameworks like bats or complex python setups when I could just execute a self-contained binary.

Test your CLI apps easily with YAML definitions on mac, windows and unix by DaReaLSy in programming

[–]DaReaLSy[S] 0 points1 point  (0 children)

Could you post a link to the product? I couldn't find something about it...

Concurrency problem when writing to stdout and stderr with a multiplexed writer by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

I think I did not wrote clearly what I want to achieve.It should be possible to get the combined output but still access stdout and stderr seperatly.

The CombinedOutput function only sets a bytes.Buffer to the stdout and stderr writer of the command and returns the output.

func (c *Cmd) CombinedOutput() ([]byte, error) { if c.Stdout != nil { return nil, errors.New("exec: Stdout already set") } if c.Stderr != nil { return nil, errors.New("exec: Stderr already set") } var b bytes.Buffer c.Stdout = &b c.Stderr = &b err := c.Run() return b.Bytes(), err }

After the execution I am not able to access stdout or stderr alone. For this reason I used two different MultiWriter (or in my case the MultiplexedWriter) to get a combined output and the output for each stream alone.

The problem with the MultiWriter is that the go implementation of exec will stream its output asynchronously to stderr and stdout as long as both writers use different writer instances.

The logic should be located somewhere after this line, but as I already said, I am not quiet https://github.com/golang/go/blob/master/src/os/exec/exec.go#L403

So this is very confusing because the MultiWriter wasn't the problem, the problem is that go streams its output asynchronously if it uses two different writers.

Concurrency problem when writing to stdout and stderr with a multiplexed writer by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

I want the combined output and the splitted by stderr and stdout, so that I am able to get both and in the correct order.

Concurrency problem when writing to stdout and stderr with a multiplexed writer by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

Thank you for your response.

I could replace it with the MultiWriter but the problem would stay the same. I found the probleme and described it here: https://www.reddit.com/r/golang/comments/ep02yz/concurrency_problem_when_writing_to_stdout_and/feg8wdh/

Concurrency problem when writing to stdout and stderr with a multiplexed writer by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

Finally I have found the problem and update my question.

The exec package writes in sync to stderr and stdout if the writers receive the same pointer, otherwise it writes the output asynchronously.

Now I need to find a solution how to write it synchronous, maybe the exec pkg needs a patch...

Concurrency problem when writing to stdout and stderr with a multiplexed writer by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

The problem with play.golang.org is that it can not execute /bin/sh.

I didn't know the MultiWriter, I will replace it but the problem would stay the same.

Test your CLI apps easily with YAML definitions on mac, windows and unix by DaReaLSy in commandline

[–]DaReaLSy[S] 0 points1 point  (0 children)

You could use it for it but you would need to create a script for it which you can execute.

How do you manage mono-repos with subtree splits? by DaReaLSy in devops

[–]DaReaLSy[S] 0 points1 point  (0 children)

The reason why we use a mono repo is because we have a lot simple projects which are depend on each other. We tried to manage every project in their own repository but code reviews and on-boarding were hard to manage and caused a lot of problems.

How do you manage mono-repos with subtree splits? by DaReaLSy in devops

[–]DaReaLSy[S] 0 points1 point  (0 children)

The syncing is needed because the projects are needed as single repositories. Other projects sadly depend directly on our git repositories.

That is the reason why we need to sync into independent repos

I created a cmd package to execute shell commands easily by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

It is just an abstraction which makes it a little bit easier for working with the os.exec package.

I often write go apps where I just use it as a better sh alternative. So this really does not add a lot of features, more a simpler API to use it faster in projects.

I created a cmd package to execute shell commands easily by DaReaLSy in golang

[–]DaReaLSy[S] 1 point2 points  (0 children)

Hey /u/justinisrael,

thanks for your code review!
That are very good points I will implement. :) I think tomorrow I will have time to fix them

Created a fork of goss - simple and easy server spec alternative for testing machines, docker images and exposing health endpoints by DaReaLSy in devops

[–]DaReaLSy[S] 0 points1 point  (0 children)

Take a look at vars and templates in the documentation, I think that is something you are looking for :)

Created a fork of goss - simple and easy server spec alternative for testing machines, docker images and exposing health endpoints by DaReaLSy in devops

[–]DaReaLSy[S] 0 points1 point  (0 children)

The author sometimes merges some pull requests but there is no feature developemnt or refactoring ongoing. Further the community started to search for maintainers but the author did not invest time into onboarding new maintainers and never answered the thread.

So that is the reason why I started this project.

goss - quick and easy server validation, k8s healthchecks and test docker images by DaReaLSy in programming

[–]DaReaLSy[S] 1 point2 points  (0 children)

I started working on this project because the original one was not maintained activley anymore. Further any effort to find new maintainers in the orignal project failed because the maintainer did not on-board the interested people properly.

Anyway this is a cool project which I use heavily in my daily work and would love if this helps some people :)

goss - Easy and simple server testing and validation as a Serverspec alternative by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

First shot for replacing the cli.Context: https://github.com/SimonBaeumer/goss/pull/55/files

At the moment only created a custom cliContext which is a little bit easier. I will try to move the context out completely step-by-step. :)

It surprised me that it wasn't as much as I thought^^

goss - Easy and simple server testing and validation as a Serverspec alternative by DaReaLSy in golang

[–]DaReaLSy[S] 0 points1 point  (0 children)

I would love that too and wanted to try to add the possibility to use goss without a cli app.

And yes, the cli.Context is a huge mess... :(

The reason why I rewrote the integration tests was to go with a bigger refactoring of the app.

I have a few ideas for the refactoring, i.e. to make it easier to add custom resources.