Skip to content

Commit 99b243d

Browse files
authored
Modify "run this sample" section for step by step instructions
1 parent 867dac3 commit 99b243d

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

  • samples/containers/unit-testing/tsqlt-docker

samples/containers/unit-testing/tsqlt-docker/README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,24 @@ The trigger we have wrote is to prevent the insertion of new products with value
5555

5656
<!-- Step by step instructions -->
5757

58-
The implementation of the trigger and related unit tests has been done.
58+
1. If you don't already have one, [sign up for a new GitHub account](https://docs.github.com/get-started/signing-up-for-github/signing-up-for-a-new-github-account)
59+
2. Create your sample repository on GitHub, if you've never done it, you can find the guide [here](https://docs.github.com/get-started/quickstart/create-a-repo)
60+
3. Create a `.github/workflows` directory in your GitHub repository if this directory does not already exist
61+
4. Copy the `automated-tests.yml` inside the directory `.github/workflows` you created in the previous step. The `automated-tests.yml` describes the process that will execute one or more jobs
62+
5. Create the `source` and `unit-test` directories in the root of your sample repository
63+
6. Copy all the files located in the source and unit-test directories to their respective directories in your repository
64+
7. View and run the workflow as described [here](https://docs.github.com/actions/quickstart)
65+
8. Have fun with the solution details outlined below
66+
67+
**The challenge**
68+
69+
The implementation of the trigger and related unit tests has been done, all files are ready in your repository!
5970

6071
The challenge is to automate the execution of the tests at each commit on the main branch of the repository. GitHub Actions is our CI/CD platform, it supports the use of Docker containers and it is intimately integrated into GitHub, the source control that manages our source code.
6172

6273
**Create your first workflow**
6374

64-
Let's go ahead with the creation of a workflow: an automated and configurable process that will execute one or more jobs.
65-
66-
Workflows are defined with a YAML file stored in the same repository which holds the source code. The workflows will be triggered when an event occurs in the repository. Anyway, a workflow can also be activated manually or according to a defined schedule. Follow [these instructions](https://docs.github.com/en/actions/quickstart) to create your first workflow.
75+
Workflows are defined with a YAML file stored in the same repository which holds the source code. The workflows will be triggered when an event occurs in the repository. Anyway, a workflow can also be activated manually or according to a defined schedule.
6776

6877
A sample YAML file that implements the test automation workflow is available here, the fundamental steps are:
6978

@@ -208,16 +217,23 @@ The YAML script for our workflow is complete, you can find it here.
208217

209218
## Sample details
210219

211-
Describe sample details
220+
Unit tests developed for a SQL Server solution are not just meant to verify that requirements have been met once, prior to release; the real game changer is represented by the possibility of repeating the checks during the development of new code and during the bug fixing process.
221+
222+
The repeatability of the tests provides the ability to automate them, an essential condition for integrating automatic tests within a Continuous Integration platform. In this article we described how to automate the testing of SQL Server objects using tSQLt, Docker and GitHub Actions!
212223

213224
<a name=disclaimers></a>
214225

215226
## Disclaimers
216-
The code included in this sample is not intended to be ...
227+
228+
The code included in this sample is not intended to be a set of best practices on how to build scalable enterprise grade unit testing or CI/CD system. This is beyond the scope of this quick start sample.
217229

218230
<a name=related-links></a>
219231

220232
## Related Links
221233
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
222234

223235
For more information, see these articles:
236+
237+
- [Unit testing: What it is and why it is important for T-SQL code!](https://medium.com/@segovoni/unit-testing-what-it-is-and-why-it-is-important-for-t-sql-code-7e9df7ca8bfe)
238+
- [Unit testing: The tSQLt framework and the execution of a test!](https://segovoni.medium.com/unit-testing-the-tsqlt-framework-and-the-execution-of-a-test-e4d135c3e343)
239+
- [Unit testing: How to write your first unit test for T-SQL code](https://segovoni.medium.com/unit-testing-how-to-write-your-first-unit-test-for-t-sql-code-3bc1533acbbc)

0 commit comments

Comments
 (0)