This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Tauri App | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish-artifacts: | |
strategy: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on: https://blog.leog.me/discourse-sso-with-auth0-e49486d0294a | |
// This must be the last action in the flow, as it potentially redirects the user to discourse and doesn't have a `onContinuePostLogin` hook as we're not expecting Discourse to return them | |
const DISCOURSE_AUTH0_CLIENT_ID = "<Your client ID>"; | |
const DISCOURSE_DOMAIN = "<Your Discourse Domain>"; | |
// We use this to avoid sending users to Discourse with unverified emails | |
// As we want Auth0 to handle email verification by default, not Discourse. | |
// If they're sent to discourse then they'll receive an email from discourse as well as Auth0 asking to independently verify their emails. | |
const DISCOURSE_NON_VERIFIED_EMAIL_REDIRECT_URL = "<A URL for users with unverified emails>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a: | |
00863395735779106D01A3B: 30 | |
00863531904040789C8A4C6: 31 | |
00863604179437128DD9A2B: 32 | |
00873485276243227609735: 33 | |
0087352270643094413B0D7: 34 | |
008736034269259128AC6C7: 35 | |
00883394559972599E77AEC: 36 | |
008B3600524843455E61C85: 37 | |
008C3378065645906E77882: 38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest.mock import patch, Mock, create_autospec | |
from pytest import fixture | |
from service.example import SomeObjectToTest | |
from service.imported_class import SomeClassOutOfOurControl | |
class TestSomeObjectToTest: | |
@fixture | |
def expected_result(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import abstractmethod | |
class SomeClassOutOfOurControl: | |
@abstractmethod | |
def add(self, items): | |
raise NotImplementedError("We don't care about this") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest.mock import patch, Mock | |
from pytest import fixture | |
from src.example import SomeObjectToTest | |
class TestSomeObjectToTest: | |
@fixture | |
def expected_result(self): | |
return 400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import abstractmethod | |
class SomeClassOutOfOurControl: | |
@abstractmethod | |
def add(self, a, b): | |
raise NotImplementedError("We don't care about this") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from src.imported_class import SomeClassOutOfOurControl | |
class SomeObjectToTest: | |
some_property = 5 | |
some_other_property = 10 | |
def __init__(self): | |
self.calculator = SomeClassOutOfOurControl() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is just a snippet, not a complete file | |
try { | |
stage('Unit Tests') { | |
// Build our base image | |
app = docker.build("our-service:PR-${BUILD_ID}") | |
// Build our test image passing our base image version and our test dockerfile | |
docker.build("our-service-test:PR-$BUILD_ID", "--build-arg BUILD_VERSION=PR-$BUILD_ID . -f test.Dockerfile") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG BUILD_VERSION | |
FROM our-service:$BUILD_VERSION | |
COPY test /app/test | |
COPY dev-requirements.txt /app/ | |
RUN pip install -r dev-requirements.txt | |
CMD python -m pytest --junitxml /app/results.xml --cov=/app/our_codebase --cov-report xml test/ |
NewerOlder