Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Disable tests on Confluence Server temporarily #56

Merged
merged 4 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
confluence-version: [Cloud, Server]
confluence-version: [Cloud]
include:
- confluence-version: Cloud
confluence-base-url: CONFLUENCE_CLOUD_BASE_URL
confluence-username: CONFLUENCE_CLOUD_USERNAME
confluence-token: CONFLUENCE_CLOUD_TOKEN
gauge-tags: "!not-cloud"
- confluence-version: Server
confluence-base-url: CONFLUENCE_SERVER_BASE_URL
confluence-username: CONFLUENCE_SERVER_USERNAME
confluence-token: CONFLUENCE_SERVER_TOKEN
confluence-username-without-create-space: CONFLUENCE_SERVER_USERNAME_WITHOUT_CREATE_SPACE
confluence-token-without-create-space: CONFLUENCE_SERVER_TOKEN_WITHOUT_CREATE_SPACE

steps:
- name: Set up Go
Expand Down
2 changes: 1 addition & 1 deletion functional-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ languages.each {lang ->
doFirst {
gauge {
specsDir = 'specs'
inParallel = true
inParallel = false
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions internal/confluence/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,23 @@ func (c *Client) IsSpaceModifiedSinceLastPublished(spaceKey string, lastPublishe
}

// WasPageCreatedAt returns true if the page was created at the given time.
func (c *Client) WasPageCreatedAt(cqlTime string, pageID string) bool {
func (c *Client) WasPageCreatedAt(cqlTime string, pageID string) (bool, error) {
query := goconfluence.SearchQuery{
CQL: fmt.Sprintf("created=\"%s\" AND ID=\"%s\"", cqlTime, pageID),
}
result, _ := c.goconfluenceClient.Search(query)
result, err := c.goconfluenceClient.Search(query)

if err != nil {
return false, err
}

for _, r := range result.Results {
if pageID == r.Content.ID {
return true
return true, nil
}
}

return false
return false, nil
}

// TotalPagesInSpace returns the number of pages (and blogposts) in the given Space
Expand Down
8 changes: 6 additions & 2 deletions internal/confluence/homepage.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ func (h *homepage) cqlTimeOffset() (int, error) {
err := errors.Retry(5, 1000, func() (err error) { //nolint:gomnd
for o := minOffset; o <= maxOffset; o++ {
cqlTime := h.created.CQLFormat(o)
wasPageCreatedAtCQLTime, err := h.apiClient.WasPageCreatedAt(cqlTime, h.id)
if err != nil {
return err
}

if h.apiClient.WasPageCreatedAt(cqlTime, h.id) {
if wasPageCreatedAtCQLTime {
logger.Debugf(false, "Successfully calculated time offset for Confluence CQL searches: UTC %+d hours", o)
offset = o
return
return nil
}
}
return fmt.Errorf("could not calculate time offset for Confluence CQL searches")
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "confluence",
"version": "0.15.0",
"version": "0.15.1",
"name": "Confluence",
"description": "Publishes Gauge specifications to Confluence",
"install": {
Expand Down